DO_TEST(44, "a # b\n", "echo a '#' b");
DO_TEST(45, "a # b\n", "echo a \\# b");
DO_TEST(46, "a\n", "#unbalanced; 'quotes\"\necho a # b");
+ DO_TEST(47, "a\n", "\\# ignored;echo a\n'#also' ignored");
# undef DO_TEST
give numeric names to domains, however, doing so will result in a
domain that can only be identified by domain id. In other words, if a
numeric value is supplied it will be interpreted as a domain id, not
-as a name.
+as a name. Any I<command> starting with B<#> is treated as a comment
+and silently ignored, all other unrecognized I<command>s are diagnosed.
The B<virsh> program can be used either to run one I<COMMAND> by giving the
command and its arguments on the shell command line, or a I<COMMAND_STRING>
virt-admin [OPTION]... <command> [ARG]...
-Where I<command> is one of the commands listed below.
+Where I<command> is one of the commands listed below. Any I<command>
+starting with B<#> is treated as a comment and silently ignored, all
+other unrecognized I<command>s are diagnosed.
The B<virt-admin> program can be used either to run one I<COMMAND> by giving the
command and its arguments on the shell command line, or a I<COMMAND_STRING>
}
if (cmd == NULL) {
- /* first token must be command name */
- if (!(cmd = vshCmddefSearch(tkdata))) {
+ /* first token must be command name or comment */
+ if (*tkdata == '#') {
+ do {
+ VIR_FREE(tkdata);
+ tk = parser->getNextArg(ctl, parser, &tkdata, false);
+ } while (tk == VSH_TK_ARG);
+ VIR_FREE(tkdata);
+ break;
+ } else if (!(cmd = vshCmddefSearch(tkdata))) {
if (!partial)
vshError(ctl, _("unknown command: '%s'"), tkdata);
goto syntaxError; /* ... or ignore this command only? */