X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCommandLine.html;h=47ab2cc074dda4aa8ab4be56e522a014a9e71460;hb=64849ce66fd01b5da5b59ea987770283a6ba48b1;hp=cb77a4348efe2ed3f386f793920db8f8de586e45;hpb=f021f8a5acd5ed9d4651fd9b07edbe6b6c38635c;p=oota-llvm.git diff --git a/docs/CommandLine.html b/docs/CommandLine.html index cb77a4348ef..47ab2cc074d 100644 --- a/docs/CommandLine.html +++ b/docs/CommandLine.html @@ -44,7 +44,7 @@
  • Option Modifiers
  • Top-Level Classes and Functions @@ -1167,13 +1175,13 @@ that does not support it.
  • Option modifiers are the flags and expressions that you pass into the constructors for cl::opt and cl::list. These modifiers give you the ability to -tweak how options are parsed and how --help output is generated to fit +tweak how options are parsed and how -help output is generated to fit your application well.

    -

    These options fall into five main catagories:

    +

    These options fall into five main categories:

      -
    1. Hiding an option from --help output
    2. +
    3. Hiding an option from -help output
    4. Controlling the number of occurrences required and allowed
    5. Controlling whether or not a value must be @@ -1182,9 +1190,9 @@ your application well.

    6. Miscellaneous option modifiers
    -

    It is not possible to specify two options from the same catagory (you'll get +

    It is not possible to specify two options from the same category (you'll get a runtime error) to a single option, except for options in the miscellaneous -catagory. The CommandLine library specifies defaults for all of these settings +category. The CommandLine library specifies defaults for all of these settings that are the most useful in practice and the most common, which mean that you usually shouldn't have to worry about these.

    @@ -1192,29 +1200,29 @@ usually shouldn't have to worry about these.

    The cl::NotHidden, cl::Hidden, and cl::ReallyHidden modifiers are used to control whether or not an option -appears in the --help and --help-hidden output for the +appears in the -help and -help-hidden output for the compiled program:

    @@ -1255,7 +1263,7 @@ indicates that the specified option must be specified exactly one time. indicates that the option must be specified at least one time.
  • The cl::ConsumeAfter modifier is described in the Positional arguments section
  • +href="#positional">Positional arguments section. @@ -1328,7 +1336,7 @@ when extending the library.

    The formatting option group is used to specify that the command line option has special abilities and is otherwise different from other command line -arguments. As usual, you can only specify at most one of these arguments.

    +arguments. As usual, you can only specify one of these arguments at most.

    -

    So far, these are the only two miscellaneous option modifiers.

    +

    So far, these are the only three miscellaneous option modifiers.

    + +
    + + +
    + Response files +
    + +
    + +

    Some systems, such as certain variants of Microsoft Windows and +some older Unices have a relatively low limit on command-line +length. It is therefore customary to use the so-called 'response +files' to circumvent this restriction. These files are mentioned on +the command-line (using the "@file") syntax. The program reads these +files and inserts the contents into argv, thereby working around the +command-line length limits. Response files are enabled by an optional +fourth argument to +cl::ParseEnvironmentOptions +and +cl::ParseCommandLineOptions. +

    +
    Top-Level Classes and Functions @@ -1470,7 +1508,8 @@ available.

    The cl::ParseCommandLineOptions function requires two parameters (argc and argv), but may also take an optional third parameter which holds additional extra text to emit when the ---help option is invoked.

    +-help option is invoked, and a fourth boolean parameter that enables +response files.

    @@ -1487,16 +1526,18 @@ as cl::ParseCommandLineOptions, except that it is designed to take values for options from an environment variable, for those cases in which reading the command line is not convenient or -not desired. It fills in the values of all the command line option variables -just like cl::ParseCommandLineOptions does.

    -

    It takes three parameters: first, the name of the program (since -argv may not be available, it can't just look in argv[0]), -second, the name of the environment variable to examine, and third, the optional +

    It takes four parameters: the name of the program (since argv may +not be available, it can't just look in argv[0]), the name of the +environment variable to examine, the optional additional extra text to emit when the ---help option is invoked.

    +-help option is invoked, and the boolean +switch that controls whether response files +should be read.

    cl::ParseEnvironmentOptions will break the environment variable's value up into words and then process them using @@ -1518,7 +1559,7 @@ input.

    The cl::SetVersionPrinter function is designed to be called -directly from main, and before +directly from main and before cl::ParseCommandLineOptions. Its use is optional. It simply arranges for a function to be called in response to the --version option instead of having the CommandLine library print out the usual version string @@ -1648,7 +1689,7 @@ the conversion from string to data.

    The cl::extrahelp class is a nontemplated class that allows extra -help text to be printed out for the --help option.

    +help text to be printed out for the -help option.

     namespace cl {
    @@ -1656,7 +1697,7 @@ help text to be printed out for the --help option.

    }
    -

    To use the extrahelp, simply construct one with a const char* +

    To use the extrahelp, simply construct one with a const char* parameter to the constructor. The text passed to the constructor will be printed at the bottom of the help message, verbatim. Note that multiple cl::extrahelp can be used, but this practice is discouraged. If @@ -1783,7 +1824,7 @@ it.

    This approach works well in situations where you would line to parse an option using special syntax for a not-very-special data-type. The drawback of this approach is that users of your parser have to be aware that they are using -your parser, instead of the builtin ones.

    +your parser instead of the builtin ones.

    @@ -1807,16 +1848,16 @@ this the default for all unsigned options.

    Our new class inherits from the cl::basic_parser template class to -fill in the default, boiler plate, code for us. We give it the data type that -we parse into (the last argument to the parse method so that clients of -our custom parser know what object type to pass in to the parse method (here we -declare that we parse into 'unsigned' variables.

    +fill in the default, boiler plate code for us. We give it the data type that +we parse into, the last argument to the parse method, so that clients of +our custom parser know what object type to pass in to the parse method. (Here we +declare that we parse into 'unsigned' variables.)

    For most purposes, the only method that must be implemented in a custom parser is the parse method. The parse method is called whenever the option is invoked, passing in the option itself, the option name, the string to parse, and a reference to a return value. If the string to parse -is not well formed, the parser should output an error message and return true. +is not well-formed, the parser should output an error message and return true. Otherwise it should return false and set 'Val' to the parsed value. In our example, we implement parse as:

    @@ -1825,7 +1866,7 @@ our example, we implement parse as:

    const std::string &Arg, unsigned &Val) { const char *ArgStart = Arg.c_str(); char *End; - + // Parse integer part, leaving 'End' pointing to the first non-integer char Val = (unsigned)strtol(ArgStart, &End, 0); @@ -1842,7 +1883,7 @@ our example, we implement parse as:

    default: // Print an error message if unrecognized character! - return O.error(": '" + Arg + "' value invalid for file size argument!"); + return O.error("'" + Arg + "' value invalid for file size argument!"); } } } @@ -1865,7 +1906,7 @@ MFS("max-file-size", cl::desc("Maximum file si
     OPTIONS:
    -  -help                 - display available options (--help-hidden for more)
    +  -help                 - display available options (-help-hidden for more)
       ...
       -max-file-size=<size> - Maximum file size to accept
     
    @@ -1925,9 +1966,9 @@ tutorial.


    Valid CSS! + src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"> Valid HTML 4.01! + src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> Chris Lattner
    LLVM Compiler Infrastructure