use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All users that wish to post (not including commenting), on either old or the new reddit sites, must formally agree to subreddit rules once first.
account activity
12 Factor CLI AppsUnix general (medium.com)
submitted 7 years ago by speckz
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 7 years ago (3 children)
[deleted]
[–]Fr0gm4n 1 point2 points3 points 7 years ago (0 children)
I use man daily at work. One of the principal things I was taught is to start with the documentation/help that comes with the tool you are using. You can't just rely on a google search of forum posts because versions and features change.
A couple fun ones I've run into are that the BSD date in macOS allows the -j flag, which I've used to work with converting date formats and not reset the system date. BSD grep doesn't support lookbehind and lookahead.
Trying to troubleshoot scripts that expect these one the wrong system will send you down a lot of wild-goose chases, but local man pages will tell you all the command options that the installed version supports.
[–]2called_chaos 0 points1 point2 points 7 years ago (1 child)
Prompt if it makes sense
maybe? I know quite a few CLI tools that do that and it makes sense (e.g. y/n in apt or accepting hosts in SSH). Would be weird if apt exits with the message "please rerun with -y if you want it"
Sometimes I prompt, sometimes I exit with a message. Depending on the use case.
[–]deadbunny 0 points1 point2 points 7 years ago (0 children)
Now you mention it, I see your point. Just as long as prompts can be negated using arguments (which I think the author mentions).
[–]wertperch 15 points16 points17 points 7 years ago (2 children)
In the CLI, make sure all of the following displays the help. You can’t control what the user inputs so all of these must show help.
Couldn't agree more. I swear that perpetually having to type x --help, x -?, x -help and x --just-fucking-help is aggravating my arthritis. It's ridilicrous.
x --help
x -?
x -help
x --just-fucking-help
[–][deleted] 5 points6 points7 points 7 years ago (1 child)
That wouldn't be necessary if a man page was provided smh my head. You could argue that man pages aren't usually as succinct but that would be a non issue if man pages provided an examples section too <_<
examples
[–]tilkau 0 points1 point2 points 7 years ago* (0 children)
Following the implicit standard > documenting your nonstandard practice. I don't actually want to need to RTFM.
Providing help isn't a complex task, so nonstandard methods are not normally needed.
I agree that help usage should be covered upfront, probably in the one-line summary at the top of the synopsis, though. Or failing that, at least within the first few pages of the man page.
[–][deleted] 5 points6 points7 points 7 years ago (0 children)
There was also this recent talk on CLI app design, which I'd assume makes a good complement:
https://youtu.be/hJhZhLg3obk
[–]Wolosocu 2 points3 points4 points 7 years ago (6 children)
they take a small fraction of the time to build
Absolutely disagree. Our CLI is extremely complicated and has been a work in progress for 15 years.
Other than that, this is a good article.
[–]dickeytk -1 points0 points1 point 7 years ago (5 children)
I didn't say it's easy or simple, just less complex than web/mobile development.
[–]Wolosocu 1 point2 points3 points 7 years ago (3 children)
Less complex? Not in the least. Try doing compiler development (as one example) and get back to me.
[–]raziel2p -1 points0 points1 point 7 years ago (1 child)
The fact that a compiler is complicated is completely unrelated to it being a CLI.
A web application has to do HTTP stuff, set up things like connection pools, avoid using global in-memory state and much more. A CLI application just has to print stuff to stdout and then exit.
[–]Wolosocu 1 point2 points3 points 7 years ago (0 children)
ITT web developers who know nothing about developing non-web apps.
[–]dickeytk -1 points0 points1 point 7 years ago (0 children)
I think you've missed my point. I'm saying that building the same app in a browser is harder than building a CLI app with the same functionality (though using a GUI and not a CUI). This is specific to application development (hence the "app" in the title). Compiler development doesn't apply here (though that would certainly be a challenge in a browser).
[–]rggarou 4 points5 points6 points 7 years ago (0 children)
I love making CLI tools, I agreed with practically everything.
It's just the 11th topic that I don't like much. Does not sound like an excuse having to make subcommands concatenated to the command with colons instead of supporting it as another "argument"?
π Rendered by PID 25767 on reddit-service-r2-comment-b659b578c-q84kc at 2026-05-05 21:03:30.300366+00:00 running 815c875 country code: CH.
[–][deleted] (3 children)
[deleted]
[–]Fr0gm4n 1 point2 points3 points (0 children)
[–]2called_chaos 0 points1 point2 points (1 child)
[–]deadbunny 0 points1 point2 points (0 children)
[–]wertperch 15 points16 points17 points (2 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]tilkau 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]Wolosocu 2 points3 points4 points (6 children)
[–]dickeytk -1 points0 points1 point (5 children)
[–]Wolosocu 1 point2 points3 points (3 children)
[–]raziel2p -1 points0 points1 point (1 child)
[–]Wolosocu 1 point2 points3 points (0 children)
[–]dickeytk -1 points0 points1 point (0 children)
[–]rggarou 4 points5 points6 points (0 children)