Next: , Previous: , Up: Top   [Contents][Index]


4 Command Line Syntax

Most command line options 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 -f name, or -fname. Here, -f 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. -cvl is equivalent to -c -v -l. 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 option names are probably easier to memorize than their short counterparts. They consist of two dashes, followed by a multi-letter option name, which is usually selected to be a mnemonics for the operation it requests. For example, --verbose is a long option that increases the verbosity of a utility. In addition, long option names can abbreviated, provided that such an abbreviation is unique among the options understood by a given utility. For example, if a utility takes options --foreground and --forward, then the shortest possible abbreviations for these options are --fore and --forw, correspondingly. If you try to use --for, the utility will abort and inform you that the abbreviation you use is ambiguous, so it is not clear which of the options you intended to use.

Long options which require arguments take those arguments following the option name. There are two ways of specifying a mandatory argument. It can be separated from the option name either by an equal sign, or by any amount of white space characters. For example, if the --file option requires an argument, and you wish to supply name as its argument, then you can do so using any of the following notations: --file=name or --file name.

The following table summarizes the options available for smapd. For each option a brief description is given and a cross reference is provided to more in-depth explanation in the body of the manual.

-c file
--config=file

Read configuration from file, instead of the default /etc/smapd.conf. See –config.

-t
--lint

Test configuration and exit with code ‘0’ if the file parsed without errors and ‘78’ otherwise. Any errors found are reported on the standard error. See –lint.

-f
--foreground

Do not detach from the controlling terminal, operate in foreground.

-e
--stderr

Output diagnostic to stderr. See logging.

-l
--syslog

Output diagnostic to syslog (default). See logging.

-s
--single-process

Operate in single-process mode. This option is intended to help in debugging smapd. Do not use it in production environment!

-i
--inetd

Operate in inetd mode (see inetd-mode).

-T
--trace

Trace queries and replies. See Query traces.

-p pattern
--trace-pattern=pattern

Trace only queries that begin with the given pattern. See trace-pattern.

-d level
-x level
--debug=level

Set debug verbosity level. See Debugging information. The -x alias is for compatibility with version 1.0 and will be removed in subsequent releases.

-L
--log-tag=tag

Set syslog tag. See logging.

-F facility
--log-facility=facility

Set syslog facility. See log-facility.

-h
--help

Give a concise summary of the command line options.

--usage

Give a short usage reminder.

-V
--version

Print program version.


Next: , Previous: , Up: Top   [Contents][Index]