Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Abseil flag library has --help and --helpfull flag.

For a code base as large as Google's, using --helpfull to output every single flag that is defined in the libraries you depend on will output a huge wall of text and often not very useful.

I always had an idea to write a --helpful flag that will pipe --helpfull output to $PAGER. That's definitely more helpful than --helpfull.

https://abseil.io/docs/python/guides/flags#special-flags



I would prefer to (and do) just add the pipe myself. More often I pipe to grep.


It took me a second to realize that this option was supposed to comprise of both the words "help" and "full". At first I was wondering if "helpfull" was a British spelling of "helpful" that I had somehow never come across below.


If I’m looking for a specific flag, or trying to understand what a specific flag does, I prefer to pipe the --help output to grep:

    ./my_cli —-help | grep -C 2 —- —-someflag


I tend to avoid doing this, for reasons someone else described in a comment (https://news.ycombinator.com/item?id=30993390): some programs spit --help output to stdout, but others to stderr, so you wind up running it a second time as “my_cli --help 2>&1 | grep ...”.

In addition, if I don’t perfectly know what I’m searching for, I’ll often get the regular expression wrong. So I prefer to check the manpage first, since it’s a lot quicker to try different search strings in my pager than by repeatedly modifying my previous command string in the shell.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: