]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_config: Add -h and --help flags handler
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>
Sat, 30 Dec 2017 18:35:52 +0000 (16:35 -0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 7 Feb 2018 11:26:26 +0000 (12:26 +0100)
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/lxc_config.c

index 0658beb8d8e77380f38129cf13a664e66462e2b1..864ff3f3a4951372c1a74aff0d621bbd2db8a9f9 100644 (file)
@@ -59,7 +59,8 @@ int main(int argc, char *argv[])
 {
        struct lxc_config_items *i;
 
-       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();