]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_config: Add -h and --help flags handler 2063/head
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Sat, 30 Dec 2017 18:35:52 +0000 (16:35 -0200)
committerMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Sat, 30 Dec 2017 18:35:52 +0000 (16:35 -0200)
As the other tools already handle, show usage message when -h or --help
are used.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
src/lxc/tools/lxc_config.c

index c204447ae744499c5dd875583166d91e6c6bdb14..86187bd57cf5991c0f557aadd9388d58467aee32 100644 (file)
@@ -64,7 +64,8 @@ int main(int argc, char *argv[])
 
        setenv("LXC_UPDATE_CONFIG_FORMAT", "1", 0);
 
-       if (argc < 2)
+       if (argc < 2 || strcmp(argv[1], "-h") == 0 ||
+                       strcmp(argv[1], "--help") == 0)
                usage(argv[0]);
        if (strcmp(argv[1], "-l") == 0)
                list_config_items();