[Cialug] The Complete CLI Command, According to This Guy
Charles Dunbar
ccdunbar at gmail.com
Fri Oct 12 15:35:39 UTC 2018
>From the article:
>
> Sometimes args are just fine though when the argument is obvious such as $
> rm file_to_remove. A good rule of thumb is 1 type of argument is fine, 2
> types are very suspect, and 3 are never good.
>
The example given for preferring flags is just basically due to a poor
example they previously had:
> heroku fork FROMAPP --app TOAPP
I don't know why they decided to go from that to:
> heroku fork --from FROMAPP --to TOAPP
instead of just:
`heroku fork FROMAPP TOAPP` or `heroku fork FROMAPP --to TOAPP`
Back when I worked at Puppet, I'd get recruited by UX to help with testing
"natural" commands I'd expect to use when they worked on a new CLI
command/option. There's defiantly a history of existing commands that give
people opinions on what to expect, and some people do CLIs much better than
others.
https://puppet.com/blog/how-we-find-right-words-designing-command-line
Not saying you need a UX team to develop a nice CLI experience, but it's
something most people don't think about - until you use a CLI that goes
against everything you've touched before. I've used a few cli tools that
do nothing but cause pain and confusion each time I use them (ipmitool and
racadm come to mind initially).
Charles
On Fri, Oct 12, 2018 at 8:17 AM Jeff Chapin <chapinjeff at gmail.com> wrote:
> > If one were writing
> the rules that everyone was going to follow, one might rather say "no bare
> arguments where the meaning could in any way be unclear or confusing". And
> any time there're two arguments, it *is* unclear and confusing.
>
> mv --origin foo --destination bar
>
> just doesn't seem as user friendly as 'mv foo bar' to me. User friendly is
> not just about reading the command, but also *using* the command, and in
> unix-land, there is a long history of commands that work in this format, so
> this would be a good case of a blanket exception, imo.
>
> On Fri, Oct 12, 2018 at 8:05 AM Todd Walton <tdwalton at gmail.com> wrote:
>
> > On Tue, Oct 9, 2018 at 5:03 PM Adam Shannon <adamkshannon at gmail.com>
> > wrote:
> >
> > > > * flags -- don't use bare arguments
> > >
> > > So now we're all going to be using 'cat --file secrets.txt' ?
> > >
> >
> > There's probably some useful exceptions one could make. If one were
> writing
> > the rules that everyone was going to follow, one might rather say "no
> bare
> > arguments where the meaning could in any way be unclear or confusing".
> And
> > any time there're two arguments, it *is* unclear and confusing.
> >
> > Every time I use ln I check the help or man page before I do, just to
> make
> > sure I remember the order correctly. Every time! Is it "destination
> > link-name" or "link-name destination"? And ln (inexplicably) does not let
> > you flag which is which, so you have to get the order right. I tried to
> > rationalize it in a way that would help it stick in my mind, but that
> > didn't work. With cp and mv, for example, "copy this to there" makes
> sense
> > to me. But ln does it the reverse of how I think about it.
> >
> > --
> > Todd
> > _______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > http://cialug.org/mailman/listinfo/cialug
> >
>
>
> --
> Jeff Chapin
> President, CedarLug, retired
> President, UNIPC, "I'll get around to it"
> President, UNI Scuba Club
> Senator, NISG, retired
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
More information about the Cialug
mailing list