cmdsynopsis

Name

cmdsynopsis -- A syntax summary for a software command

Synopsis

Content Model
cmdsynopsis ::=
((command|arg|group|sbr)+,
 synopfragment*)
Attributes Common attributes

Name

Type

Default

sepchar CDATA " "
cmdlength CDATA None
label CDATA None
Parameter Entities
admon.mix bookcomponent.content component.mix
divcomponent.mix example.mix figure.mix
footnote.mix glossdef.mix indexdivcomponent.mix
listpreamble.mix para.char.mix qandaset.mix
refcomponent.mix revdescription.mix sidebar.mix
synop.class tbl.entry.mdl  

Description

A CmdSynopsis summarizes the options and parameters of a command started from a text prompt. This is usually a program started from the DOS, Windows, or UNIX shell prompt.

CmdSynopsis operates under the following general model: commands have arguments, that may be grouped; arguments and groups may be required or optional and may be repeated.

Processing expectations

The processing expectations of CmdSynopsis are fairly complex.

Parents

These elements contain cmdsynopsis: answer, appendix, application, article, attribution, bibliodiv, bibliography, bibliomisc, blockquote, callout, caution, chapter, citation, citetitle, constraintdef, emphasis, entry, example, figure, footnote, foreignphrase, glossary, glossdef, glossdiv, glosssee, glossseealso, glossterm, important, index, indexdiv, informalexample, informalfigure, itemizedlist, lineannotation, link, listitem, literallayout, lotentry, member, msgaud, msgexplan, msgtext, note, olink, orderedlist, para, partintro, phrase, preface, procedure, productname, programlisting, qandadiv, qandaset, question, quote, refentrytitle, refsect1, refsect2, refsect3, refsection, refsynopsisdiv, remark, revdescription, screen, screeninfo, sect1, sect2, sect3, sect4, sect5, section, seg, setindex, sidebar, simpara, simplesect, step, synopsis, term, tip, tocback, tocentry, tocfront, ulink, variablelist, warning.

Children

The following elements occur in cmdsynopsis: arg, command, group, sbr, synopfragment.

Attributes

cmdlength

CmdLength indicates displayed length of the command; this information may be used to intelligently indent command synopses which extend beyond one line.

label

Label specifies an identifying number or string that may be used in presentation.

sepchar

SepChar specifies the character (a space by default) that should separate the Command and its top-level arguments.

See Also

arg, funcsynopsis, group, refsynopsisdiv, sbr, synopfragment, synopfragmentref, synopsis.

Examples

<!DOCTYPE cmdsynopsis PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<cmdsynopsis>
  <command>cd</command>
  <arg choice='req'><replaceable>directory</replaceable></arg>
</cmdsynopsis>

cd {directory}

<!DOCTYPE cmdsynopsis PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<cmdsynopsis>
  <command>cal</command>
  <arg>-j</arg>
  <arg>-y</arg>
  <arg>month <arg>year</arg></arg>
</cmdsynopsis>

cal [-j] [-y] [month [year]]

<!DOCTYPE cmdsynopsis PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<cmdsynopsis>
  <command>chgrp</command>
  <arg>-R
    <group>
      <arg>-H</arg>
      <arg>-L</arg>
      <arg>-P</arg>
    </group>
  </arg>
  <arg>-f</arg>
  <arg choice='plain'><replaceable>group</replaceable></arg>
  <arg rep='repeat' choice='plain'><replaceable>file</replaceable></arg>
</cmdsynopsis>

chgrp [-R [-H | -L | -P] ] [-f] group file...

<!DOCTYPE cmdsynopsis PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<cmdsynopsis>
  <command>emacs</command>
  <arg>-t <replaceable>file</replaceable></arg>
  <arg>-q</arg>
  <arg>-u <replaceable>user</replaceable></arg>
  <arg>+<replaceable>number</replaceable></arg>
  <arg rep='repeat'>-f <replaceable>function</replaceable></arg>
  <sbr/>
  <arg rep='repeat'>-l <replaceable>file</replaceable></arg>
  <arg rep='repeat' choice='plain'><replaceable>file</replaceable></arg>
</cmdsynopsis>

emacs [-t file] [-q] [-u user] [+number] [-f function...]
[-l file...] file...

Note the use of SBR in this example to force line breaks at reasonable places in the synopsis.

For additional examples, see also refentry, synopfragment.