Exploring CLI Best Practices
I&#x27;d expand on this and say every command line program should support GNU getopt_long() syntax, since this is the most popular syntax for command line interfaces and it saves having to guess the syntax when using a program for the first time. This doesn&#x27;t mean all programs should use getopt_long(), but they should understand all the syntax that getopt_long() understands, such that someone could reimplement the program&#x27;s command line interface using getopt_long() and get exactly the same behaviour.<p>This means, for example, supporting both space-separated and equals-separated option values (--name value and --name=value). Some programs only support one or the other, so you have to guess which will be supported when invoking a program for the first time. Both forms have their uses too. --name=value is more explicit and should throw an error if the --name option doesn&#x27;t take a value, so it&#x27;s good for use in scripts. On the other hand, a lot of shells don&#x27;t tab-complete file names unless the file name is in a separate argument, so for interactive use, --name value can be more convenient.