* [TUHS] Re: Of flags and keyletters @ 2024-03-02 22:14 Noel Chiappa 2024-03-03 17:38 ` Aaron 0 siblings, 1 reply; 6+ messages in thread From: Noel Chiappa @ 2024-03-02 22:14 UTC (permalink / raw) To: tuhs; +Cc: jnc > From: Bakul Shah > Use of "flag" for this purpose seems strange. "option" makes more sense. People on this list seem to forget that there were computers before UNIX. The _syntax_ of "-f" probably predates any UNIX; Multics used it extensively. See the "Introduction to Multics", MAC-TR-123, January 1974 (a little after UNIX V1, but I expect I could probably track it back further in time, if I cared to put in the effort); pg. 3-24. Interestingly, I looked though the CTSS manual, and CTSS did not seem to use this syntax for flag arguments: see, e.g., the SAVE command (section AH.3.03). The _name_ "flag" came in early on UNIX. (Multics called them "arguments"; see above, pg. 3-27, top line.) We can see this happen - see: http://squoze.net/UNIX/v1man/man1/du which calls the "-a" and "-s" "arguments"; but in: http://squoze.net/UNIX/v1man/man1/ld "-s", "-u", etc are called "flag arguments". Long enough ago that certainty about the etymology/rationale is probably now lost. Noel ^ permalink raw reply [flat|nested] 6+ messages in thread
* [TUHS] Re: Of flags and keyletters 2024-03-02 22:14 [TUHS] Re: Of flags and keyletters Noel Chiappa @ 2024-03-03 17:38 ` Aaron 2024-03-03 17:52 ` Larry McVoy ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Aaron @ 2024-03-03 17:38 UTC (permalink / raw) To: tuhs Having written the first versions of getopt(3), getopt(1), and associated man pages around 1979, I do not recall any real orthodoxy in the use of ‘options’ vs ‘flags.’ In general, ‘flags’ seemed to be reserved for single arguments in the form of ‘-x’ I wrote getopt, and rewrote many commands to use it because I got annoyed at trying to remember which commands required “-x -y -z” vs “-xyz”, and which flags required or allowed optional arguments. Aaron > On Mar 2, 2024, at 5:22 PM, jnc@mercury.lcs.mit.edu wrote: > > >> >> From: Bakul Shah > >> Use of "flag" for this purpose seems strange. "option" makes more sense. > > People on this list seem to forget that there were computers before UNIX. > > The _syntax_ of "-f" probably predates any UNIX; Multics used it extensively. > See the "Introduction to Multics", MAC-TR-123, January 1974 (a little after > UNIX V1, but I expect I could probably track it back further in time, if I > cared to put in the effort); pg. 3-24. > > Interestingly, I looked though the CTSS manual, and CTSS did not seem to use > this syntax for flag arguments: see, e.g., the SAVE command (section AH.3.03). > > > The _name_ "flag" came in early on UNIX. (Multics called them "arguments"; > see above, pg. 3-27, top line.) We can see this happen - see: > > http://squoze.net/UNIX/v1man/man1/du > > which calls the "-a" and "-s" "arguments"; but in: > > http://squoze.net/UNIX/v1man/man1/ld > > "-s", "-u", etc are called "flag arguments". > > Long enough ago that certainty about the etymology/rationale is probably now > lost. > > Noel ^ permalink raw reply [flat|nested] 6+ messages in thread
* [TUHS] Re: Of flags and keyletters 2024-03-03 17:38 ` Aaron @ 2024-03-03 17:52 ` Larry McVoy 2024-03-03 19:28 ` Aaron 2024-03-03 18:44 ` [TUHS] Re: getopt Phil Budne 2024-03-03 21:24 ` [TUHS] Re: Of flags and keyletters Rich Salz 2 siblings, 1 reply; 6+ messages in thread From: Larry McVoy @ 2024-03-03 17:52 UTC (permalink / raw) To: tuhs I rewrote getopt() for BitKeeper because I wanted long options and wanted to allow optional args but also have required args. On Sun, Mar 03, 2024 at 12:38:20PM -0500, Aaron wrote: > Having written the first versions of getopt(3), getopt(1), and associated man pages around 1979, I do not recall any real orthodoxy in the use of ???options??? vs ???flags.??? In general, ???flags??? seemed to be reserved for single arguments in the form of ???-x??? > > I wrote getopt, and rewrote many commands to use it because I got annoyed at trying to remember which commands required ???-x -y -z??? vs ???-xyz???, and which flags required or allowed optional arguments. > > Aaron > > > > > On Mar 2, 2024, at 5:22???PM, jnc@mercury.lcs.mit.edu wrote: > > > > ??? > >> > >> From: Bakul Shah > > > >> Use of "flag" for this purpose seems strange. "option" makes more sense. > > > > People on this list seem to forget that there were computers before UNIX. > > > > The _syntax_ of "-f" probably predates any UNIX; Multics used it extensively. > > See the "Introduction to Multics", MAC-TR-123, January 1974 (a little after > > UNIX V1, but I expect I could probably track it back further in time, if I > > cared to put in the effort); pg. 3-24. > > > > Interestingly, I looked though the CTSS manual, and CTSS did not seem to use > > this syntax for flag arguments: see, e.g., the SAVE command (section AH.3.03). > > > > > > The _name_ "flag" came in early on UNIX. (Multics called them "arguments"; > > see above, pg. 3-27, top line.) We can see this happen - see: > > > > http://squoze.net/UNIX/v1man/man1/du > > > > which calls the "-a" and "-s" "arguments"; but in: > > > > http://squoze.net/UNIX/v1man/man1/ld > > > > "-s", "-u", etc are called "flag arguments". > > > > Long enough ago that certainty about the etymology/rationale is probably now > > lost. > > > > Noel -- --- Larry McVoy Retired to fishing http://www.mcvoy.com/lm/boat ^ permalink raw reply [flat|nested] 6+ messages in thread
* [TUHS] Re: Of flags and keyletters 2024-03-03 17:52 ` Larry McVoy @ 2024-03-03 19:28 ` Aaron 0 siblings, 0 replies; 6+ messages in thread From: Aaron @ 2024-03-03 19:28 UTC (permalink / raw) To: Larry McVoy, tuhs Unix has long benefited from the notion that everything can be improved! Sent from my iPhone > On Mar 3, 2024, at 12:53 PM, Larry McVoy <lm@mcvoy.com> wrote: > > I rewrote getopt() for BitKeeper because I wanted long options and > wanted to allow optional args but also have required args. > >> On Sun, Mar 03, 2024 at 12:38:20PM -0500, Aaron wrote: >> Having written the first versions of getopt(3), getopt(1), and associated man pages around 1979, I do not recall any real orthodoxy in the use of ???options??? vs ???flags.??? In general, ???flags??? seemed to be reserved for single arguments in the form of ???-x??? >> >> I wrote getopt, and rewrote many commands to use it because I got annoyed at trying to remember which commands required ???-x -y -z??? vs ???-xyz???, and which flags required or allowed optional arguments. >> >> Aaron >> >> >> >>>> On Mar 2, 2024, at 5:22???PM, jnc@mercury.lcs.mit.edu wrote: >>> >>> ??? >>>> >>>> From: Bakul Shah >>> >>>> Use of "flag" for this purpose seems strange. "option" makes more sense. >>> >>> People on this list seem to forget that there were computers before UNIX. >>> >>> The _syntax_ of "-f" probably predates any UNIX; Multics used it extensively. >>> See the "Introduction to Multics", MAC-TR-123, January 1974 (a little after >>> UNIX V1, but I expect I could probably track it back further in time, if I >>> cared to put in the effort); pg. 3-24. >>> >>> Interestingly, I looked though the CTSS manual, and CTSS did not seem to use >>> this syntax for flag arguments: see, e.g., the SAVE command (section AH.3.03). >>> >>> >>> The _name_ "flag" came in early on UNIX. (Multics called them "arguments"; >>> see above, pg. 3-27, top line.) We can see this happen - see: >>> >>> http://squoze.net/UNIX/v1man/man1/du >>> >>> which calls the "-a" and "-s" "arguments"; but in: >>> >>> http://squoze.net/UNIX/v1man/man1/ld >>> >>> "-s", "-u", etc are called "flag arguments". >>> >>> Long enough ago that certainty about the etymology/rationale is probably now >>> lost. >>> >>> Noel > > -- > --- > Larry McVoy Retired to fishing http://www.mcvoy.com/lm/boat ^ permalink raw reply [flat|nested] 6+ messages in thread
* [TUHS] Re: getopt 2024-03-03 17:38 ` Aaron 2024-03-03 17:52 ` Larry McVoy @ 2024-03-03 18:44 ` Phil Budne 2024-03-03 21:24 ` [TUHS] Re: Of flags and keyletters Rich Salz 2 siblings, 0 replies; 6+ messages in thread From: Phil Budne @ 2024-03-03 18:44 UTC (permalink / raw) To: tuhs Aaron wrote: > Having written the first versions of getopt(3), getopt(1), and associated man pages around 1979 ... > I wrote getopt, and rewrote many commands to use it because I got > annoyed at trying to remember which commands required “-x -y -z” vs > “-xyz”, and which flags required or allowed optional arguments. For posterity, can you tell us more about where/when/how it happened? Where were you working, and on what project?? I found an acknowledgement of your work on p9 of the paper that starts at https://www.tuhs.org/Archive/Documentation/AUUGN/AUUGN-V05.3.pdf#page=27 "Proposed Syntax Standard for UNIX* System Commands": Acknowledgments We are indebted to Jerry Vogel and Aaron Cohen: after evaluating the problem, we arrived at asolution very similar to the one they championed five years ago. References for the above proposal: Hemenway, K., & Armitage, H. (1984) Proposed Syntax Standard for UNIX System Commands. In Summer USENIX Conference. El Cerito, CA: Usenix Association. Proposed syntax standard for UNIX system commands K Hemenway, H Armitage - UNIX/world, 1984 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [TUHS] Re: Of flags and keyletters 2024-03-03 17:38 ` Aaron 2024-03-03 17:52 ` Larry McVoy 2024-03-03 18:44 ` [TUHS] Re: getopt Phil Budne @ 2024-03-03 21:24 ` Rich Salz 2 siblings, 0 replies; 6+ messages in thread From: Rich Salz @ 2024-03-03 21:24 UTC (permalink / raw) To: Aaron; +Cc: tuhs [-- Attachment #1: Type: text/plain, Size: 513 bytes --] On Sun, Mar 3, 2024 at 12:38 PM Aaron <aaronscohen@gmail.com> wrote: > Having written the first versions of getopt(3), getopt(1), and associated > man pages around 1979 ... > I always thought that this was a brilliant piece of engineering. In less than 70 lines, it was a clever, but not obtuse, bit of code to handle the most common option/flag/switch usages that pervaded the Unix ecosystem at the time. Thanks for that! Source: https://www.linux.co.cr/unix-source-code/review/1985/1103.html [-- Attachment #2: Type: text/html, Size: 898 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-03 21:24 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-03-02 22:14 [TUHS] Re: Of flags and keyletters Noel Chiappa 2024-03-03 17:38 ` Aaron 2024-03-03 17:52 ` Larry McVoy 2024-03-03 19:28 ` Aaron 2024-03-03 18:44 ` [TUHS] Re: getopt Phil Budne 2024-03-03 21:24 ` [TUHS] Re: Of flags and keyletters Rich Salz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).