]> 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>
Tue, 2 Jan 2018 00:17:32 +0000 (01:17 +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/tools/lxc_config.c

index c26b1a0aa8b596fc1b671d7f13c0941eae2e2a81..07d1fdedb8ce96d27c1b884b94d8073a23957468 100644 (file)
@@ -62,8 +62,10 @@ int main(int argc, char *argv[])
        struct lxc_config_items *i;
        const char *value;
 
-       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();
        for (i = &items[0]; i->name; i++) {