3.1 Option Basics

Options start with a dash. Most of them have two forms, called short and long forms. Both forms are absolutely identical in function; they are interchangeable.

The short form is a traditional form for UNIX utilities. In this form, the option consists of a single dash, followed by a single letter, e.g. ‘-c’.

Short options which require arguments take their arguments immediately following the option letter, optionally separated by white space. For example, you might write ‘-o name’, or ‘-oname’. Here, ‘-o’ is the option, and ‘name’ is its argument.

Short options' letters may be clumped together, but you are not required to do this. When short options are clumped as a set, use one (single) dash for them all, e.g. ‘-ne’ is equivalent to ‘-n -e’. However, only options that do not take arguments may be clustered this way. If an option takes an argument, it can only be the last option in such a cluster, otherwise it would be impossible to specify the argument for it. Anyway, it is much more readable to specify such options separated.

The long options consist of two dashes, followed by a multi-letter option name, which is usually selected to be a mnemonics for the operation it requests. Long option names can be abbreviated, provided that such an abbreviation is unique among the options understood by the program.

Arguments to long options follow the option name being separated from it either by an equal sign, or by any amount of white space characters. For example, the option ‘--eval’ with the argument ‘test’ can be written either as ‘--eval=test’ or as ‘--eval test’.