Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 15 submissions in the queue.
posted by Fnord666 on Wednesday March 04 2020, @04:51AM   Printer-friendly
from the get-off-my-lawn dept.

The growth of command line options, 1979-Present

The first of McIlroy's dicta is often paraphrased as "do one thing and do it well", which is shortened from "Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new 'features.'" [ . . . ]

If you open up a manpage for ls on mac, you'll see that it starts with

ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]

That is, the one-letter flags to ls include every lowercase letter except for {jvyz}, 14 uppercase letters, plus @ and 1. That's 22 + 14 + 2 = 38 single-character options alone.

On ubuntu 17, if you read the manpage for coreutils ls, you don't get a nice summary of options, but you'll see that ls has 58 options (including --help and --version).

To see if ls is an aberration or if it's normal to have commands that do this much stuff, we can look at some common commands, sorted by frequency of use.

(see article for interesting table.)

We can see that the number of command line options has dramatically increased over time; entries tend to get darker going to the right (more options) and there are no cases where entries get lighter (fewer options).

McIlroy has long decried the increase in the number of options, size, and general functionality of commands:

Everything was small and my heart sinks for Linux when I see the size [inaudible]. The same utilities that used to fit in eight k[ilobytes] are a meg now. And the manual page, which used to really fit on, which used to really be a manual page, is now a small volume with a thousand options... We used to sit around in the UNIX room saying "what can we throw out? Why is there this option?" It's usually, it's often because there's some deficiency in the basic design -- you didn't really hit the right design point. Instead of putting in an option, figure out why, what was forcing you to add that option. This viewpoint, which was imposed partly because there was very small hardware ... has been lost and we're not better off for it.

[ . . . . ] Another reason commands now have more options is that people have added convenience flags for functionality that could have been done by cobbling together a series of commands. These go all the way back to v7 unix, where ls has an option to reverse the sort order (which could have been done by passing the output to tac).

Over time, more convenience options have been added. For example, to pick a command that originally has zero options, mv can move and create a backup (three options; two are different ways to specify a backup, one of which takes an argument and the other of which takes zero explicit arguments and reads an implicit argument from the VERSION_CONTROL environment variable; one option allows overriding the default backup suffix). mv now also has options to never overwrite and to only overwrite if the file is newer.

mkdir is another program that used to have no options where, excluding security things for SELinux or SMACK as well as help and version options, the added options are convenience flags: setting the permissions of the new directory and making parent directories if they don't exist.

[ . . . ] unlike with a GUI, adding these options doesn't clutter up the interface.

(emphasis added)

No worry, systemd will guide us back to the true Unix Microsoft way.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Insightful) by gtomorrow on Wednesday March 04 2020, @08:18AM (8 children)

    by gtomorrow (2230) on Wednesday March 04 2020, @08:18AM (#966406)

    Wow! That was just so...spiteful!

    Apparently, posts don't have a character limit or abbreviate to a "more..." link like articles do.

    Starting Score:    1  point
    Moderation   +1  
       Insightful=1, Total=1
    Extra 'Insightful' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 0) by Anonymous Coward on Wednesday March 04 2020, @03:59PM

    by Anonymous Coward on Wednesday March 04 2020, @03:59PM (#966506)

    The poster could have been polite and put that "book" inside a spoiler tag...but it seems that many people never learned good manners.

  • (Score: 3, Funny) by DannyB on Wednesday March 04 2020, @05:51PM (3 children)

    by DannyB (5839) Subscriber Badge on Wednesday March 04 2020, @05:51PM (#966570) Journal

    Wow! That was just so...spiteful!

    You mean . . . +1 inspiteful.

    --
    To transfer files: right-click on file, pick Copy. Unplug mouse, plug mouse into other computer. Right-click, paste.
    • (Score: 2) by gtomorrow on Wednesday March 04 2020, @07:47PM (2 children)

      by gtomorrow (2230) on Wednesday March 04 2020, @07:47PM (#966659)

      Danny, do you stay up all night to invent these horrible puns or do they just come extemporaneously? 🤣

      • (Score: 2) by DannyB on Wednesday March 04 2020, @09:43PM (1 child)

        by DannyB (5839) Subscriber Badge on Wednesday March 04 2020, @09:43PM (#966711) Journal

        They come naturally. On the fly.

        --
        To transfer files: right-click on file, pick Copy. Unplug mouse, plug mouse into other computer. Right-click, paste.
        • (Score: 2) by hendrikboom on Thursday March 05 2020, @12:02AM

          by hendrikboom (1125) Subscriber Badge on Thursday March 05 2020, @12:02AM (#966756) Homepage Journal

          I believe that. I once had a friend who claimed his head was in the Cosmic Pun Stream. Very few of his sentences were without puns.

  • (Score: 0) by Anonymous Coward on Wednesday March 04 2020, @06:11PM (2 children)

    by Anonymous Coward on Wednesday March 04 2020, @06:11PM (#966587)

    AC who posted the man page here.

    Don't blame me, Gaark *asked* for it [soylentnews.org].

    And putting it in spoiler tags would have given the impression that Gaark was wrong. He wasn't.
    • (Score: 2) by gtomorrow on Wednesday March 04 2020, @07:50PM (1 child)

      by gtomorrow (2230) on Wednesday March 04 2020, @07:50PM (#966661)

      Oh, well then.

      Remind me to never wish for a million dollars to rain on me. You'd probably deliver in pennies.

      • (Score: 0) by Anonymous Coward on Wednesday March 04 2020, @08:24PM

        by Anonymous Coward on Wednesday March 04 2020, @08:24PM (#966675)

        You'd probably deliver in pennies.

        In rolls too, to make sure there were some skull fractures involved.

        wink, wink, nudge, nudge ;)