diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-06-14 09:29:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-06-14 09:29:53 +0200 |
commit | 253412624e0fa60a309c6691b0cd99b6c341df87 (patch) | |
tree | d261ea96f8b29388beb93ec1b05b7b972aa548c1 /commands | |
parent | 6191ef93b25edbd75caec9213db3665f486ee433 (diff) | |
parent | c35624d1946a4756c93bdb489f4790176b6e2dcc (diff) | |
download | barebox-253412624e0fa60a309c6691b0cd99b6c341df87.tar.gz barebox-253412624e0fa60a309c6691b0cd99b6c341df87.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'commands')
-rw-r--r-- | commands/edit.c | 2 | ||||
-rw-r--r-- | commands/help.c | 2 | ||||
-rw-r--r-- | commands/mount.c | 13 | ||||
-rw-r--r-- | commands/test.c | 2 | ||||
-rw-r--r-- | commands/true.c | 3 | ||||
-rw-r--r-- | commands/usbgadget.c | 3 |
6 files changed, 14 insertions, 11 deletions
diff --git a/commands/edit.c b/commands/edit.c index 696a818d9d..290222ce15 100644 --- a/commands/edit.c +++ b/commands/edit.c @@ -559,7 +559,7 @@ out: return ret; } -static const char *edit_aliases[] = { "sedit", NULL}; +static const char * const edit_aliases[] = { "sedit", NULL}; BAREBOX_CMD_HELP_START(edit) BAREBOX_CMD_HELP_TEXT("Use cursor keys, Ctrl-C to exit and Ctrl-D to exit-with-save.") diff --git a/commands/help.c b/commands/help.c index 819c40653c..34ffa9a419 100644 --- a/commands/help.c +++ b/commands/help.c @@ -139,7 +139,7 @@ BAREBOX_CMD_HELP_OPT ("-a", "output help on all commands") BAREBOX_CMD_HELP_OPT ("-v", "verbose") BAREBOX_CMD_HELP_END -static const char *help_aliases[] = { "?", NULL}; +static const char * const help_aliases[] = { "?", NULL}; BAREBOX_CMD_START(help) .cmd = do_help, diff --git a/commands/mount.c b/commands/mount.c index aa769d46fe..4cf1179b7b 100644 --- a/commands/mount.c +++ b/commands/mount.c @@ -29,7 +29,7 @@ static int do_mount(int argc, char *argv[]) int opt, verbose = 0; struct driver_d *drv; const char *type = NULL; - const char *mountpoint, *dev; + const char *mountpoint, *devstr; const char *fsoptions = NULL; while ((opt = getopt(argc, argv, "ao:t:v")) > 0) { @@ -70,11 +70,11 @@ static int do_mount(int argc, char *argv[]) return 0; } + devstr = argv[optind]; + if (argc == optind + 1) { struct cdev *cdev; - const char *path, *devstr; - - devstr = argv[optind]; + const char *path; if (!strncmp(devstr, "/dev/", 5)) devstr += 5; @@ -97,8 +97,6 @@ static int do_mount(int argc, char *argv[]) if (argc < optind + 2) return COMMAND_ERROR_USAGE; - dev = argv[optind]; - if (argc == optind + 3) { /* * Old behaviour: mount <dev> <type> <mountpoint> @@ -109,7 +107,7 @@ static int do_mount(int argc, char *argv[]) mountpoint = argv[optind + 1]; } - return mount(dev, type, mountpoint, fsoptions); + return mount(devstr, type, mountpoint, fsoptions); } BAREBOX_CMD_HELP_START(mount) @@ -119,6 +117,7 @@ BAREBOX_CMD_HELP_TEXT("With -a the mount command mounts all block devices whose BAREBOX_CMD_HELP_TEXT("can be detected automatically to /mnt/PARTNAME") BAREBOX_CMD_HELP_TEXT("If mountpoint is not given, a standard mountpoint of /mnt/DEVICE") BAREBOX_CMD_HELP_TEXT("is used. This directoy is created automatically if necessary.") +BAREBOX_CMD_HELP_TEXT("With -o loop the mount command mounts a file instead of a device.") BAREBOX_CMD_HELP_TEXT("") BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT("-a\t", "mount all blockdevices") diff --git a/commands/test.c b/commands/test.c index d0f63c1391..c4f493860f 100644 --- a/commands/test.c +++ b/commands/test.c @@ -224,7 +224,7 @@ out: return expr; } -static const char *test_aliases[] = { "[", NULL}; +static const char * const test_aliases[] = { "[", NULL}; BAREBOX_CMD_HELP_START(test) BAREBOX_CMD_HELP_TEXT("Options:") diff --git a/commands/true.c b/commands/true.c index 24dea46929..ad2be8e8eb 100644 --- a/commands/true.c +++ b/commands/true.c @@ -26,7 +26,10 @@ static int do_true(int argc, char *argv[]) return 0; } +static const char * const true_aliases[] = { ":", NULL}; + BAREBOX_CMD_START(true) + .aliases = true_aliases, .cmd = do_true, BAREBOX_CMD_DESC("do nothing, successfully") BAREBOX_CMD_GROUP(CMD_GRP_SCRIPT) diff --git a/commands/usbgadget.c b/commands/usbgadget.c index 02c2c96b02..ba09f97847 100644 --- a/commands/usbgadget.c +++ b/commands/usbgadget.c @@ -106,7 +106,8 @@ BAREBOX_CMD_HELP_TEXT("") BAREBOX_CMD_HELP_TEXT("Options:") BAREBOX_CMD_HELP_OPT ("-a", "Create CDC ACM function") BAREBOX_CMD_HELP_OPT ("-s", "Create Generic Serial function") -BAREBOX_CMD_HELP_OPT ("-A <desc>", "Create Android Fastboot function") +BAREBOX_CMD_HELP_OPT ("-A [desc]", "Create Android Fastboot function. If 'desc' is not provided,") +BAREBOX_CMD_HELP_OPT ("", "trying to use 'global.usbgadget.fastboot_function' variable.") BAREBOX_CMD_HELP_OPT ("-D <desc>", "Create DFU function") BAREBOX_CMD_HELP_OPT ("-d", "Disable the currently running gadget") BAREBOX_CMD_HELP_END |