documentation/cif_syntax.pod
changeset 16 18a55d594fba
parent 7 184a1eb85cf2
child 95 b3ffff030d5c
equal deleted inserted replaced
15:6bb86f60191e 16:18a55d594fba
    14 
    14 
    15 I<This documentation is only useful for developers of fshell commands.>
    15 I<This documentation is only useful for developers of fshell commands.>
    16 
    16 
    17 =head2 Introduction
    17 =head2 Introduction
    18 
    18 
    19 Command Info Files (CIFs) can be used to define the interface and documentation for fshell commands that are implemented using CCommandBase. Where previously details of arguments and options etc. were specified in C++ source code, the majority of this information can now be defined in a CIF, which is a plain text file. The format of CIFs is similar to POD (Perl's documentation source format), but with an additional set of key-words that relate to the specifics of command interfaces.
    19 Command Info Files (CIFs) can be used to define the interface and documentation for fshell commands that are implemented using CCommandBase. Where previously details of arguments and options etc. were specified in C++ source code, the majority of this information can now be defined in a CIF, which is a plain text file. The format of CIFs is similar to POD (Perl's documentation source format), but with an additional set of keywords that relate to the specifics of command interfaces.
    20 
    20 
    21 CIF files for fshell commands live in F<\resource\cif\fshell> and should be named I<commandname>.cif where I<commandname> is the same as what is returned by the command's Name() function.
    21 CIF files for fshell commands live in F<\resource\cif\fshell> and should be named I<commandname>.cif where I<commandname> is the same as what is returned by the command's Name() function.
    22 
    22 
    23 =head2 Syntax
    23 =head2 Syntax
    24 
    24 
    70 
    70 
    71 An argument with just the C<multiple> attribute can be specified one or more times, C<optional> means zero or one times. An argument may have both C<optional> and C<multiple> to indicate it can be specified zero or more times.
    71 An argument with just the C<multiple> attribute can be specified one or more times, C<optional> means zero or one times. An argument may have both C<optional> and C<multiple> to indicate it can be specified zero or more times.
    72 
    72 
    73 =item *
    73 =item *
    74 
    74 
    75 Only the final argument is allowed to have the C<last> attribute. It indicates that further arguments are allowed without needing to quote them and will be merged into this argument. C<last> may not be combined with C<multiple>. If a string provided for a C<last> argument naturally (i.e. as a result of normal string quote and escape handling) forms a single argument and consumes the whole of the remainder of the command line, the resulting single argument will be used as is. Otherwise, the string will be used without any quote or escape handling. Here are some example (using fshell's 'time' command, which takes a single argument that uses the C<last> attribute):
    75 Only the final argument is allowed to have the C<last> attribute. It indicates that further arguments are allowed without needing to quote them and will be merged into this argument. C<last> may not be combined with C<multiple>. If a string provided for a C<last> argument naturally (i.e. as a result of normal string quote and escape handling) forms a single argument and consumes the whole of the remainder of the command line, the resulting single argument will be used as is. Otherwise, the string will be used without any quote or escape handling. Here are some examples (using fshell's 'time' command, which takes a single argument that uses the C<last> attribute):
    76 
    76 
    77       Input command-line            Argument receive by the 'time' command
    77       Input command-line            Argument receive by the 'time' command
    78 
    78 
    79  1)   time echo foo                 echo foo
    79  1)   time echo foo                 echo foo
    80  2)   time 'echo foo'               echo foo
    80  2)   time 'echo foo'               echo foo
   165         TOperation iOperation;
   165         TOperation iOperation;
   166         };
   166         };
   167     ...
   167     ...
   168     void CMyCommand::ArgumentsL(RCommandArgumentList& aArguments)
   168     void CMyCommand::ArgumentsL(RCommandArgumentList& aArguments)
   169         {
   169         {
   170         aArguments.AppendEnum((TInt&)iOperation, _L("operation"));
   170         aArguments.AppendEnumL((TInt&)iOperation, _L("operation"));
   171         }
   171         }
   172 
   172 
   173 The CIF file would therefore contain:
   173 The CIF file would therefore contain:
   174 
   174 
   175     ==argument enum operation optional
   175     ==argument enum operation optional