SDF 2.001beta1: SDF Reference: sdfcli - Command Line Interface Utility

Contents | Parent Topic | Previous Topic | Next Topic
Home | Catalog

# 11.5. sdfcli - Command Line Interface Utility

## Purpose

sdfcli extracts command line interface (CLI) information from applications and formats it into SDF.

## Usage

    usage  : sdfcli [-h[help]] [-o[out_ext]]
             [-l[log_ext]] [-w wrap] utility ...
    purpose: format a utility's command line interface into SDF
    version: 2.000    (SDF 2.001beta1)

The options are:

Option | Description
-h | display help on options
-o | output file extension
-l | log file extension
-w | column at which to wrap option specifications

## Description

The -h option provides help. If it is specified without a parameter, a brief description of each option is displayed. To display the attributes for an option, specify the option letter as a parameter.

By default, generated output goes to standard output. To direct output to a file per input file, use the -o option to specify an extension for output files. If the -o option is specified without a parameter, an extension of out is assumed.

Likewise, error messages go to standard error by default. Use the -l option to create a log file per input file. If the -l option is specified without a parameter, an extension of log is assumed.

sdfcli executes each argument with a -h flag and converts the resultant output to nicely formatted SDF. An argument of "-" specifies that the help should be read from standard input.

Formatting is done as follows:

1. lines are tagged as Example paragraphs, with the first line formatted to wrap option usage specifications nicely
2. if a line is found that starts with 'options:', it is replaced with a Body paragraph saying "The options are:", and the following lines are formatted as a table of codes and descriptions
3. if a line is found that starts with 'aliases:', it is replaced with a Body paragraph saying "The aliases are:", and the following lines are formatted as a table of names and descriptions
4. each option code in the table is formatted as a hypertext jump to a tag called cmd_opt where:
   - cmd is the command name
   - opt is the option code

The -w option specifies at what column to wrap option specifications. The default is 50 - this is the best for output imported into the Mincom templates.

## Limitations and future directions

The table formats used are hard coded.

Contents | Parent Topic | Previous Topic | Next Topic
Home | Catalog