Ask HN: What are the best and worst command-line interfaces you have used?
33 points| de_keyboard | 4 years ago
What are some of the best and worst command-line interfaces you have used?
33 points| de_keyboard | 4 years ago
What are some of the best and worst command-line interfaces you have used?
[+] [-] urxvtcd|4 years ago|reply
From the time I was a teen I think I remember that mount was difficult to use, and mounting a CD image required passing some arcane options, though maybe I just didn't know how to use it (on the other hand I didn't know how to use Daemon Tools either, and it just worked).
I don't have a problem with git though. I don't think it's the command-line interface that's hostile, it's git itself if you don't know what you're doing. After taking some time to learn it I actually enjoy solving difficult problems with git.
[+] [-] doteka|4 years ago|reply
[+] [-] DanielVZ|4 years ago|reply
[+] [-] Ristovski|4 years ago|reply
[+] [-] LittlePeter|4 years ago|reply
[+] [-] tombl|4 years ago|reply
[0]: https://theunarchiver.com/command-line
[+] [-] thunderbong|4 years ago|reply
[+] [-] jquast|4 years ago|reply
[+] [-] jasode|4 years ago|reply
By default (without specifying extra command-line options) it overwrites the input files. [1]
In decades of computer use, that is the only command line tool that tricked me into destroying my data because I didn't realize it works differently from all the other tools I use that don't do that.
Usually, a command line utility with less options specified is relatively "safe" and you have to add extra syntax to make it "unsafe".
It was definitely a violation of: https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...
EDIT reply to: >The whole reason for mogrify's existence is that it overwrites the original image file.
Sure, I understand that but many other destructive tools will have safety UI features such as creating ".bak" backup files. That's what many other command line tools do including image utilities. So something like mogrify could have been designed with hypothetical syntax as "mogrify -nobackups". The principle is to type extra syntax to make it more dangerous while still accomplishing the (observable) goal of changing the original files.
[1] https://superuser.com/questions/1575004/imagemagick-how-to-a...
[+] [-] captn3m0|4 years ago|reply
The whole reason for mogrify's existence is that it overwrites the original image file.
[+] [-] cozzyd|4 years ago|reply
[+] [-] bduffany|4 years ago|reply
[+] [-] BoxOfRain|4 years ago|reply
[+] [-] gglitch|4 years ago|reply
[+] [-] btschaegg|4 years ago|reply
For interactive shell scripting:
- AWK. Old enough to be part of the POSIX standard and yet considerably more awesome than almost any other UNIX command.
- socat for any kind of network/socket testing stuff.
- sponge and entr just for their genuine usefulness with minimal interface.
For interactive use:
- SSH. I mean, obviously. It's also astounding how well OpenSSH integrates into the whole *NIX TTY landscape. You can use it for years and still learn neat things about it.
- Vim. Yes, it's obscure to learn, but once you do, boy do you get a lot out of it. Also: Since `:terminal`, working on one-off scripts has become considerably more awesome.
- htop and btop++ are good examples of TUIs for interactive use.
- tig is also quite cool for many git interactions (especially partial staging).
- lnav for log analysis tasks.
For batch jobs you set up and trigger as needed:
- Beets (see: beets.io). It's impressive how streamlined it works once you've set it up.
Bad:
- Pretty much anything Microsoft. I really don't understand how it's possible to consistently produce bad CLI programs for such a long time.
- As a prime example, have a look at `sc sdshow` and `sc sdset`.
Edit: Perhaps to clarify about the sc SDDL commands:
If you look them up, you won't find much "bad" in their documentation. Because nothing about the SDDL syntax they are built on is documented. The best you can do is scrape together what you can from third-party blogposts with a perceived signal:noise ratio of .000001.
And SDDL in itself is phenomenally badly designed. And, of course, this being Microsoft, the tool isn't designed to be used together with other programs.
[+] [-] rwmj|4 years ago|reply
[+] [-] frou_dh|4 years ago|reply
[+] [-] qsort|4 years ago|reply
[+] [-] sergiotapia|4 years ago|reply
i'm used to it now but when I was learning, "what the fuck did `git reset --hard` do? where is --soft? Is there a no-flag version? What the fuck did I leave mercurial for. God damn I miss svn."
I still kind of miss Mercurial and TortoiseHG.
[+] [-] MontyCarloHall|4 years ago|reply
`git reset` both unstages files (opposite of `git add`, straightforward enough) but also can move the current HEAD pointer to an arbitrary commit. You’d think it could then also discard unstaged changes, but nope, that’s `git checkout -- …`, which incidentally has nothing to do with `git checkout`’s other functionality of switching branches.
There are so many other examples of this. `git rebase` can not only rebase but also combine and reorder commits via `rebase -i`, which seems totally unrelated to rebasing. `git branch` and `git checkout` have overlapping but also distinct functionality. I could go on for hours.
[+] [-] lcall|4 years ago|reply
I also found myself making myself a "gh" script to make finding/opening the right git manpage easier/quicker.
I always thought the UI of "git commit --interactive" was at a sweet spot of being both helpful and efficient, once I got familiar with it the first time. It is easier to remember than command-line options. Related UI details in another comment in this page.
[+] [-] linspace|4 years ago|reply
Mercurial was much better IMO but people argued about performance, because, you know, the CPU is the bottleneck when I merge code. How much time has been wasted navigating Stack Overflow?
[+] [-] zombietfk|4 years ago|reply
[+] [-] kwertyoowiyop|4 years ago|reply
[+] [-] amznbyebyebye|4 years ago|reply
[+] [-] horstbort|4 years ago|reply
[+] [-] codemusings|4 years ago|reply
EDIT: Oops backspace works. Might have been a combination of putty and sqlplus. Nevermind.
[+] [-] MontyCarloHall|4 years ago|reply
Occasionally I’ll still encounter an environment that only has a minimalist implementation of sh (e.g. some busybox builds) and be totally stymied. It amazes me how much people accomplished on old *nix systems with such abysmal usability.
[+] [-] visiblink|4 years ago|reply
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.
[+] [-] notacoward|4 years ago|reply
[+] [-] BlackLotus89|4 years ago|reply
[+] [-] notacoward|4 years ago|reply
[+] [-] runjake|4 years ago|reply
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.
[+] [-] adonovan|4 years ago|reply
[+] [-] cpach|4 years ago|reply
https://tailordev.github.io/Watson/
https://brew.sh/
[+] [-] randomluck040|4 years ago|reply
[+] [-] blakesterz|4 years ago|reply
[+] [-] Cicero22|4 years ago|reply
[+] [-] stackedinserter|4 years ago|reply
Kubectl is among the best: commands make sense and have internal logic, interface is discoverable, output is configurable and supports different formats.
[+] [-] sam_lowry_|4 years ago|reply
k9s would save us all from carpal syndrome, but it's a curses UI, not a cli.
[+] [-] urxvtcd|4 years ago|reply
[+] [-] BoxOfRain|4 years ago|reply
[+] [-] speedgoose|4 years ago|reply
Maybe a good command line user interface is one you don't notice nor remember. It just work smoothly. So I will start with cat.
[+] [-] bjourne|4 years ago|reply
[+] [-] amznbyebyebye|4 years ago|reply
[+] [-] zaphirplane|4 years ago|reply
Git does this but is workable because it’s 2 levels and you don’t need to specify various flags defaults are usually ok