From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay10.mail.gandi.net ([217.70.178.230]) by ewsd; Sun Dec 9 16:39:08 EST 2018 Received: from qop (93-142-17-183.adsl.net.t-com.hr [93.142.17.183]) (Authenticated sender: vp@kvik.link) by relay10.mail.gandi.net (Postfix) with ESMTPSA id A513B240002 for <9front@9front.org>; Sun, 9 Dec 2018 21:39:03 +0000 (UTC) Message-ID: <6CFCF27E92A504A165B945790864E88F@kvik.link> From: kvik Date: Sun, 9 Dec 2018 22:38:45 +0100 To: 9front@9front.org Subject: Re: [9front] rio exit menu In-Reply-To: 20181209212953.GA71661@wopr MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-xdkdbdeldlpqghgyhptxqmjftg" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: agile SVG over SSL storage-based API persistence proxy This is a multi-part message in MIME format. --upas-xdkdbdeldlpqghgyhptxqmjftg Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I find it useful to have an "Exit" menu entry, sometimes. An opt-in option seems reasonable. --upas-xdkdbdeldlpqghgyhptxqmjftg Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -120,21 +120,22 @@ void threadmain(int argc, char *argv[]) { char *initstr, *kbdin, *s; + int exitdoor; char buf[256]; Image *i; Rectangle r; - if(strstr(argv[0], ".out") == nil){ - menu3str[Exit] = nil; - Hidden--; - } initstr = nil; kbdin = nil; maxtab = 0; + exitdoor = 0; ARGBEGIN{ case 'b': reverse = ~0xFF; break; + case 'e': + exitdoor = TRUE; + break; case 'f': fontname = EARGF(usage()); break; @@ -155,6 +156,11 @@ threadmain(int argc, char *argv[]) default: usage(); }ARGEND + + if(exitdoor == 0){ + menu3str[Exit] = nil; + Hidden--; + } if(getwd(buf, sizeof buf) == nil) startdir = estrdup("."); --upas-xdkdbdeldlpqghgyhptxqmjftg--