Live data from Hacker News

Ask HN: What are the best and worst command-line interfaces you have used?

news.ycombinator.com

31–40 of 85 posts

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#31
The best: an old CD player called Workbone on Slackware. It made great use of the number keys for pause/play/ff/rw/eject.

The worst: I used to work with an awful custom-built industrial computer.

You had to enter the 10-character alphanumeric codes of 98 rail cars into a command-line interface that didn't permit backspacing. One mistake. Car 97. Do it all again.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#32
Many of the worst ones I've used have been embedded in physical devices - ethernet or fibre channel switches, disk arrays or controllers, etc. I've been around long enough that I don't expect every CLI in the universe to have things like history, command line editing, or autocomplete, so that's OK. On the other hand, many of these interfaces are wildly inconsistent and that bugs me. Some commands are object-verb and some are verb-object. Some are abbreviated, some are verbose. One command produces an identifier in format X, but the next command consumes it in format Y so you can't even use your terminal's copy/paste function. Excessive modality is another common problem in these interfaces. Which sub-sub-sub-mode was the command I needed in, again? Can't know without actually entering that mode, and then the next related thing you have to do is in a completely different part of the tree. Using such interfaces directly can be painful, and automating them is often inordinately difficult too.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#34
The Windows Resource Kit binaries come to mind. They were distributed together in the same ZIP, but:

1. They used differing return values for success and failures. Sometimes, a 0 was a success, sometimes 1 was a success, and sometimes only 4 was a failure, but everything else was a success.

2. They used different command-line switch formats. Some utilities used a hyphen, others used a forward slash.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#35

Why is nobody hating on megacli? It's the only tool I use where I actually need a wrapper script. There are other horrible command line experiences, but nothing anyone here listed I would describe as horrible...

Megacli is definitely one of the examples I was thinking of when I said many of the worst CLIs are embedded into physical devices. What a piece of trash.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#36
post #28

Earlier quoted context omitted.

tar -czf ./file.tgz ./* edit: i do hope that is correct without checking :-)

So the dash in `-czf` if optional? Which reminds me: why does ps have two sets of options again?

Don't laugh, it's actually three sets of options now:

- UNIX options, which may be grouped and must be preceded by a dash.

- BSD options, which may be grouped and must not be used with a dash.

- GNU long options, which are preceded by two dashes.

Reference: https://man7.org/linux/man-pages/man1/ps.1.html

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#37

Not the worst (I think `tar` and `unzip` probably take the cake) but `find` is pretty atrocious IMO. The order in which you specify certain flags like `-maxdepth` relative to other option flags matters (not just relative to plain arguments, but relative to other option flags starting with `-`).

`find` is definitely one of my least favourite among the traditional Unix tools in terms of interface. `dd` is also a little weird with its syntax but at least I rarely have to use `dd`.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#38
> worst command-line interfaces

If you mean TUI wise as in curses, nearly all of them.

Command line parameters however, there are so many examples. Tar, unrar and unzip take the cake, all in the same category of tools. "unrar x" whatever it is, I always have to look it up. dd because of the way its parameters are specified: dd if=/dev/zero of=foo.bar bs=4096 count=1024 . It's all historical and I can live with it, but many of them at least have the saving grace that they have excellent manpages or you've used them so often it becomes second nature.

There should be a special place in hell for tools that combine short and long style command line options with a single dash. Like "foo -b a -r -baz 123" with "-baz" being a single option, because I will automatically add an extra dash there out of habit.

Coworkers discovering ncurses or some library around it tend to go on a TUI frenzy for a while, and it inevitably ends up being some convoluted mess nobody wants to use. I'll admit there's a few indispensable curses based tools, for instance top (and some variants along that line), but they're far and few in between. At most dialog comes to mind for dealing with prompts for end users, but I personally abhor it in anything but a setup or installation context.

Those very same coworkers also make tools with indecipherable command line options, often because they don't know the language they're working in has a standardized option parser library or module.

> best

I don't remember which tool it was, it could be "crm" (for failover, think like heartbeat and pacemaker) but I might be mistaken. It's been years since I've used it. The command line had options like so:

tool [options] section action resource_src resource_tgt

But the best part was, if you just started the tool without any options, it'd drop you into a pseudo-shell. It'd show you a blank prompt ending in ">". If you then typed "section" you'd end up with a "section>" prompt.

I remember for what I was doing with it, it felt really intuitive. At any point I could type "help section" and it'd list the available actions for that section, together with short example.

I've forgotten the real syntax, but you'd have commands like:

tool node status

tool node standby servername

tool service stop dns

tool service migrate dns secondary

If you were in the pseudo-shell, you could do:

$ service

service$ migrate dns secondary

service$ up

$ node

node$ status

node$ exit

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#39
I worked in a campus bookstore with an old terminal system to access the inventory database. It was a simple text interface. What I loved about it was that the commands to navigate were quick to learn (key was first chars in command) and the response time was instant. So you could jump to any part of the system with a few keystrokes ingrained in muscle memory.

Re: Ask HN: What are the best and worst command-line interfaces you have used?

#40
post #15

Nearly everything that packs or unpacks stuff. tar, gunzip, and else. I can never remember if they are going to unpack everything into a subdirectory or spill everything into my home, and conversely I never know if after zipping there's gonna be a directory inside or not. Luckily dtrx and atool do the thing you want most of the time. From the time I was a teen I think I remember that mount was difficult to use, and m…

A very handy tool for this is https://www.nongnu.org/atool/
Post reply on HN