Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Actually it's a f* disaster to make a good cli. You have to deal with sh, bash, fish, zsh, tsh, rush and all their forks, and then all the Mac variants of those, and then all the windows emulators variants, and then probably also windows dos and powershell
As a maintainer of an in-house cli tool, I can tell you, it can be an absolute nightmare.. -
@DarkMukke And apart from that, the "API" is also confusing as fuck.
Just color code stuff like \e[40;38;5;82m... what kind of unholy syntax is that!
And forgetting some escape code somewhere around a unicode character, you press some arrow keys and your prompt is now scrambled up in the middle of a sentence, hovering in the middle of your terminal.
Working with Bash (etc) feels super legacy, and many of its features for rendering stuff on screen are unnecessarily unsafe -- because the concept of a "terminal" was standardized in an era when unicode and even color displays didn't exist yet. -
@DarkMukke Go. :)
And @kwilliams, I don't think there should be punctuation between those words anyways 😅 -
@bittersweet have you tried s-bashing your head to the monitor or get Bash Cookbook from O'Reilly?
I did, you will have no confusions when you have the Tome... and blood loss :) -
@melezorus34
The fact that you mention a "tome" just confirms that OP is wrong though.
I understand bash quite thoroughly. Not that I would call myself an expert — but I understand it well enough to write CLI tooling in pure Bash, C or Rust; Create bash functions to manipulate data, configure a nice prompt, output a progress bar, write an ncurses interface, etc.
I just wouldn't call doing those things intuitive, or comfortable.
Even with popular CLI "frameworks" and argument parsers to make things less bashy, there's often weird edge cases. Explainable edge cases, but unintuitive nonetheless.
But it does mean that building high quality CLI tools is a craft, and depends on knowledge & experience. -
8lall01943yCan't disagree more.
Making a simple and effective CLI takes a lot of test, feedback and retry. -
@bittersweet I know, I was joking around. And that book helped me a lotta times too.
-
@ScriptCoded No Go, Go isn't a cli. It can compile you one and you'll have to have x amount on binaries for everyone possible architecture, but that doesn'take it easier, because Go doesn't have dynamic loading, so you run all 500 megs ( medium sized cli binary these days ) or non if it. And don't even get me started about all the different libs you have import to even get started.
And even after all of that, you still have write a CLI that is 100% bug free (It's compiled, nobody but you can fix/change things ) and does everything the user wants out of a CLI.
Related Rants
👏IT'S👏NOT👏THAT👏HARD👏TO👏MAKE👏A👏GOOD👏CLI
rant
cli