X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FMainpage.dox;h=3cee76732cbbc9d3b52e083056026506187eb23a;hb=6aae6e526573187ece558842e928578e5aa4cc4c;hp=48341bc74e29111e7513d02a87a5473210a7e397;hpb=fc1569e67cfda71bc8c406617a5e0b05f28f1b47;p=senf.git diff --git a/senf/Utils/Console/Mainpage.dox b/senf/Utils/Console/Mainpage.dox index 48341bc..3cee767 100644 --- a/senf/Utils/Console/Mainpage.dox +++ b/senf/Utils/Console/Mainpage.dox @@ -137,7 +137,8 @@ \section intro_commands Implementing console/config commands - \seechapter \ref console_commands + \seechapter \ref console_commands \n + \seechapter \ref senf::console::factory The console/config language does not define, how arguments are passed to the commands, it just tokenizes the input and passes the tokens to the commands which then handle the @@ -276,9 +277,19 @@ Options can be abbreviated at each directory boundary: A command /foo/bar/do can be called as --f-b-d as long as this name is unique. - Everything after the first '=' character is parsed into argument tokens using the normal - config/console parser. If the option has no '=' character, the list of argument tokens will be - empty. + Everything after the first '=' character is passed as arguments to the command. The exact + interpretation depends on the command: + \li If the command only takes a single token as argument (e.g. a single string or numeric + value), everything after the '=' sign is parsed into a single token (e.g. see rows 2 and 3 + of the following table). + \li In all other cases, the string after the '=' sign is parsed into argument tokens using the + config/console parser. In this case, quoted strings need to be quoted twice, once for the + shell and once for the config/console parser (e.g. see rows 4 and 5 of the following table). + \li If the option has no '=' character, the list of argument tokens will be empty (e.g. see row + 1 of the following table) + + Without these rules, multi-word string arguments would \e always have to be quoted twice (for + the shell and the config/console parser).
Command | File syntax | Option syntax | ||
---|---|---|---|---|
void doo(std::string const &) | -/path/to/doo "some test"; | ---path-to-doo='"some text"' | +/path/to/doo "some text"; | +--path-to-doo="some text" |
/path/to/doo take 1; | --path-to-doo="take 1" |