From mboxrd@z Thu Jan 1 00:00:00 1970
Return-path:
Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235])
by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux))
id 1Wk80s-0001gw-Aj
for barebox@lists.infradead.org; Tue, 13 May 2014 08:24:54 +0000
Received: by mail-ee0-f53.google.com with SMTP id c13so127021eek.12
for ; Tue, 13 May 2014 01:24:15 -0700 (PDT)
From: Holger Schurig
Date: Tue, 13 May 2014 10:28:42 +0200
Message-Id: <1399969739-10355-3-git-send-email-holgerschurig@gmail.com>
In-Reply-To: <1399969739-10355-1-git-send-email-holgerschurig@gmail.com>
References: <1399969739-10355-1-git-send-email-holgerschurig@gmail.com>
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "barebox"
Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org
Subject: [PATCH 02/19] commands: harmonize in-barebox documentation
To: barebox@lists.infradead.org
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig
---
arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 8 +--
arch/arm/boards/guf-cupid/board.c | 9 +---
arch/arm/boards/phytec-phycore-imx35/pcm043.c | 9 +---
arch/arm/cpu/cpuinfo.c | 2 +-
arch/arm/cpu/mmuinfo.c | 9 +---
arch/arm/lib/bootu.c | 3 +-
arch/arm/lib/bootz.c | 8 +--
arch/arm/mach-at91/boot_test_cmd.c | 8 +--
arch/arm/mach-at91/clock.c | 8 +--
arch/arm/mach-at91/gpio.c | 11 +++--
arch/arm/mach-mxs/bcb.c | 8 +--
arch/arm/mach-netx/generic.c | 3 +-
arch/arm/mach-omap/boot_order.c | 12 ++---
arch/blackfin/boards/ipe337/cmd_alternate.c | 9 +---
arch/mips/lib/cpuinfo.c | 2 +-
arch/openrisc/lib/cpuinfo.c | 2 +-
commands/2048.c | 6 +--
commands/automount.c | 12 ++---
commands/barebox-update.c | 17 +++----
commands/basename.c | 6 +--
commands/boot.c | 44 +++++++++--------
commands/bootm.c | 33 ++++++++-----
commands/cat.c | 8 ++-
commands/cd.c | 7 ++-
commands/clear.c | 6 +--
commands/clk.c | 38 +++++---------
commands/cp.c | 9 ++--
commands/crc.c | 20 +++++---
commands/detect.c | 11 +++--
commands/devinfo.c | 16 ++++--
commands/dfu.c | 27 +++++-----
commands/digest.c | 24 ++++-----
commands/dirname.c | 12 +++--
commands/echo.c | 16 +++---
commands/edit.c | 6 +--
commands/exec.c | 2 +-
commands/export.c | 6 +--
commands/false.c | 2 +-
commands/filetype.c | 14 +++---
commands/flash.c | 40 ++++++++++-----
commands/global.c | 10 ++--
commands/go.c | 14 +++---
commands/gpio.c | 35 +++----------
commands/help.c | 39 ++++++++++-----
commands/i2c.c | 48 ++++++++++--------
commands/insmod.c | 7 +--
commands/iomemport.c | 4 +-
commands/led.c | 11 +++--
commands/let.c | 43 ++++++++--------
commands/linux16.c | 16 ++++--
commands/linux_exec.c | 9 +---
commands/ln.c | 9 +---
commands/loadb.c | 19 ++++---
commands/loadenv.c | 15 +++---
commands/loads.c | 19 +++----
commands/loadxy.c | 53 ++++++++++----------
commands/login.c | 16 +++---
commands/ls.c | 12 +++--
commands/lsmod.c | 2 +-
commands/magicvar.c | 2 +-
commands/md.c | 37 +++++++-------
commands/memcmp.c | 28 ++++++-----
commands/memcpy.c | 22 +++++----
commands/meminfo.c | 2 +-
commands/memset.c | 20 ++++----
commands/memtest.c | 14 +++---
commands/menu.c | 54 ++++++++++----------
commands/menutree.c | 36 +++++++-------
commands/miitool.c | 11 +++--
commands/mkdir.c | 12 +++--
commands/mm.c | 19 ++++---
commands/mount.c | 26 +++++-----
commands/msleep.c | 3 +-
commands/mw.c | 18 ++++---
commands/nand.c | 15 +++---
commands/nandtest.c | 21 ++++----
commands/net.c | 7 +--
commands/of_node.c | 9 ++--
commands/of_property.c | 20 ++++----
commands/oftree.c | 15 +++---
commands/partition.c | 25 ++++++----
commands/passwd.c | 15 +++---
commands/poweroff.c | 2 +-
commands/printenv.c | 8 +--
commands/pwd.c | 2 +-
commands/readf.c | 10 ++--
commands/readline.c | 12 +++--
commands/readlink.c | 10 ++--
commands/reginfo.c | 2 +-
commands/regulator.c | 2 +-
commands/reset.c | 10 ++--
commands/rm.c | 11 +++--
commands/rmdir.c | 10 ++--
commands/saveenv.c | 12 +++--
commands/setenv.c | 9 ++--
commands/sleep.c | 3 +-
commands/spi.c | 24 ++++-----
commands/splash.c | 19 ++++---
commands/test.c | 14 +++---
commands/tftp.c | 9 ++--
commands/time.c | 8 +--
commands/timeout.c | 20 ++++----
commands/trigger.c | 12 +++--
commands/true.c | 2 +-
commands/ubi.c | 39 ++++++++-------
commands/ubiformat.c | 47 +++++++++---------
commands/uimage.c | 15 +++---
commands/umount.c | 10 ++--
commands/uncompress.c | 12 ++---
commands/usb.c | 10 ++--
commands/usbserial.c | 28 ++++++-----
commands/version.c | 2 +-
commands/wd.c | 10 ++--
common/command.c | 34 ++++++-------
common/hush.c | 55 +++++++++------------
drivers/gpio/gpiolib.c | 8 +--
drivers/mtd/nand/nand_imx_bbm.c | 5 +-
drivers/mtd/nand/nand_s3c24xx.c | 7 +--
include/command.h | 13 +++--
net/dhcp.c | 31 ++++--------
net/dns.c | 7 +--
net/ifup.c | 14 ++++--
net/nfs.c | 8 +--
net/ping.c | 3 +-
124 files changed, 967 insertions(+), 907 deletions(-)
diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index f7b7a23..f6ed084 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -352,14 +352,10 @@ static int do_cpufreq(int argc, char *argv[])
return 0;
}
-static const __maybe_unused char cmd_cpufreq_help[] =
-"Usage: cpufreq 399|532\n"
-"\n"
-"Set CPU frequency to MHz\n";
-
BAREBOX_CMD_START(cpufreq)
.cmd = do_cpufreq,
- .usage = "adjust CPU frequency",
+ BAREBOX_CMD_DESC("adjust CPU frequency")
+ BAREBOX_CMD_OPTS("399|532")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_cpufreq_help)
BAREBOX_CMD_END
diff --git a/arch/arm/boards/guf-cupid/board.c b/arch/arm/boards/guf-cupid/board.c
index 793d845..90f1627 100644
--- a/arch/arm/boards/guf-cupid/board.c
+++ b/arch/arm/boards/guf-cupid/board.c
@@ -346,14 +346,9 @@ static int do_cpufreq(int argc, char *argv[])
return 0;
}
-static const __maybe_unused char cmd_cpufreq_help[] =
-"Usage: cpufreq 399|532\n"
-"\n"
-"Set CPU frequency to MHz\n";
-
BAREBOX_CMD_START(cpufreq)
.cmd = do_cpufreq,
- .usage = "adjust CPU frequency",
+ BAREBOX_CMD_DESC("adjust CPU frequency")
+ BAREBOX_CMD_OPTS("399|532")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
- BAREBOX_CMD_HELP(cmd_cpufreq_help)
BAREBOX_CMD_END
diff --git a/arch/arm/boards/phytec-phycore-imx35/pcm043.c b/arch/arm/boards/phytec-phycore-imx35/pcm043.c
index f6e370f..d1dd28f 100644
--- a/arch/arm/boards/phytec-phycore-imx35/pcm043.c
+++ b/arch/arm/boards/phytec-phycore-imx35/pcm043.c
@@ -324,15 +324,10 @@ static int do_cpufreq(int argc, char *argv[])
return 0;
}
-static const __maybe_unused char cmd_cpufreq_help[] =
-"Usage: cpufreq 399|532\n"
-"\n"
-"Set CPU frequency to MHz\n";
-
BAREBOX_CMD_START(cpufreq)
.cmd = do_cpufreq,
- .usage = "adjust CPU frequency",
+ BAREBOX_CMD_DESC("adjust CPU frequency")
+ BAREBOX_CMD_OPTS("399|532")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
- BAREBOX_CMD_HELP(cmd_cpufreq_help)
BAREBOX_CMD_END
diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index 2cee48b..8b22e9b 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -210,7 +210,7 @@ static int do_cpuinfo(int argc, char *argv[])
BAREBOX_CMD_START(cpuinfo)
.cmd = do_cpuinfo,
- .usage = "Show info about CPU",
+ BAREBOX_CMD_DESC("show info about CPU")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/arch/arm/cpu/mmuinfo.c b/arch/arm/cpu/mmuinfo.c
index 032798e..79f539f 100644
--- a/arch/arm/cpu/mmuinfo.c
+++ b/arch/arm/cpu/mmuinfo.c
@@ -99,14 +99,9 @@ static int do_mmuinfo(int argc, char *argv[])
return 0;
}
-BAREBOX_CMD_HELP_START(mmuinfo)
-BAREBOX_CMD_HELP_USAGE("mmuinfo \n")
-BAREBOX_CMD_HELP_SHORT("Show MMU/cache information for an address.\n")
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(mmuinfo)
.cmd = do_mmuinfo,
- .usage = "mmuinfo ",
+ BAREBOX_CMD_DESC("show MMU/cache information of an address")
+ BAREBOX_CMD_OPTS("ADDRESS")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
- BAREBOX_CMD_HELP(cmd_mmuinfo_help)
BAREBOX_CMD_END
diff --git a/arch/arm/lib/bootu.c b/arch/arm/lib/bootu.c
index 14a8566..19009c8 100644
--- a/arch/arm/lib/bootu.c
+++ b/arch/arm/lib/bootu.c
@@ -36,7 +36,8 @@ static const __maybe_unused char cmd_bootu_help[] =
BAREBOX_CMD_START(bootu)
.cmd = do_bootu,
- .usage = "start a raw linux image",
+ BAREBOX_CMD_DESC("boot into already loaded Linux kernel")
+ BAREBOX_CMD_OPTS("ADDRESS")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_bootu_help)
BAREBOX_CMD_END
diff --git a/arch/arm/lib/bootz.c b/arch/arm/lib/bootz.c
index 7ddd882..377f18a 100644
--- a/arch/arm/lib/bootz.c
+++ b/arch/arm/lib/bootz.c
@@ -127,14 +127,10 @@ err_out:
return 1;
}
-static const __maybe_unused char cmd_bootz_help[] =
-"Usage: bootz [FILE]\n"
-"Boot a Linux zImage\n";
-
BAREBOX_CMD_START(bootz)
.cmd = do_bootz,
- .usage = "start a zImage",
+ BAREBOX_CMD_DESC("boot Linux zImage")
+ BAREBOX_CMD_OPTS("FILE")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
- BAREBOX_CMD_HELP(cmd_bootz_help)
BAREBOX_CMD_END
diff --git a/arch/arm/mach-at91/boot_test_cmd.c b/arch/arm/mach-at91/boot_test_cmd.c
index 5f80666..66c598b 100644
--- a/arch/arm/mach-at91/boot_test_cmd.c
+++ b/arch/arm/mach-at91/boot_test_cmd.c
@@ -84,13 +84,15 @@ err:
}
BAREBOX_CMD_HELP_START(at91_boot_test)
-BAREBOX_CMD_HELP_USAGE("at91_boot_test [-j ] [-s ] file\n")
-BAREBOX_CMD_HELP_SHORT("upload the binary to sram and jump as will do the romcode\n")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-j ADDR", "jump address")
+BAREBOX_CMD_HELP_OPT ("-s SRAM", "SRAM device (default /dev/sram0)")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(at91_boot_test)
.cmd = do_at91_boot_test,
- .usage = "upload the binary to sram and jump as will do the romcode",
+ BAREBOX_CMD_DESC("load and execute from SRAM")
+ BAREBOX_CMD_OPTS("at91_boot_test [-js] FILE")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_at91_boot_test_help)
BAREBOX_CMD_END
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index c4fc698..59c4d11 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -881,16 +881,10 @@ static int do_at91clk(int argc, char *argv[])
return 0;
}
-BAREBOX_CMD_HELP_START(at91clk)
-BAREBOX_CMD_HELP_USAGE("at91clk\n")
-BAREBOX_CMD_HELP_SHORT("dump current clock configuration\n");
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(at91clk)
.cmd = do_at91clk,
- .usage = "dump current clock configuration",
+ BAREBOX_CMD_DESC("list clock configuration")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
- BAREBOX_CMD_HELP(cmd_at91clk_help)
BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
#endif
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index c175cfd..d354625 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -509,13 +509,18 @@ static int do_at91mux(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(at91mux)
-BAREBOX_CMD_HELP_USAGE("at91mux [-p -b ]\n")
-BAREBOX_CMD_HELP_SHORT("dump current mux configuration if bank/pin specified dump pin details\n");
+BAREBOX_CMD_HELP_TEXT("Dump current MIX configuration. If a BANK or PIN has been")
+BAREBOX_CMD_HELP_TEXT("specified dump pin details.");
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-p PIN", "pin number")
+BAREBOX_CMD_HELP_OPT ("-b BANK", "bank number")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(at91mux)
.cmd = do_at91mux,
- .usage = "dump current mux configuration",
+ BAREBOX_CMD_DESC("list MUX configuration")
+ BAREBOX_CMD_OPTS("[-pn]")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
BAREBOX_CMD_HELP(cmd_at91mux_help)
BAREBOX_CMD_COMPLETE(empty_complete)
diff --git a/arch/arm/mach-mxs/bcb.c b/arch/arm/mach-mxs/bcb.c
index 0da8d3b..c945726 100644
--- a/arch/arm/mach-mxs/bcb.c
+++ b/arch/arm/mach-mxs/bcb.c
@@ -387,14 +387,14 @@ int update_bcb(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(bcb)
-BAREBOX_CMD_HELP_USAGE("bcb [second_bootstream]\n")
-BAREBOX_CMD_HELP_SHORT("Write a BCB to NAND flash which an MX23/28 needs to boot.\n")
-BAREBOX_CMD_HELP_TEXT ("Example: bcb nand0.bootstream\n")
+BAREBOX_CMD_HELP_TEXT("Write a BCB to NAND flash which an MX23/28 needs to boot.")
+BAREBOX_CMD_HELP_TEXT("Example: bcb nand0.bootstream")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(bcb)
.cmd = update_bcb,
- .usage = "Writes a MX23/28 BCB data structure to flash",
+ BAREBOX_CMD_DESC("writes a i.MX23/28 BCB data structure to flash")
+ BAREBOX_CMD_OPTS("BOOTSTREAM [BOOTSTREAM]")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_bcb_help)
BAREBOX_CMD_END
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c
index 0b6b3b2..6127dde 100644
--- a/arch/arm/mach-netx/generic.c
+++ b/arch/arm/mach-netx/generic.c
@@ -145,7 +145,6 @@ void __noreturn reset_cpu(unsigned long addr)
BAREBOX_CMD_START(loadxc)
.cmd = do_loadxc,
- .usage = "load xmac/xpec engine with ethernet firmware",
+ BAREBOX_CMD_DESC("load XMAC/XPEC engine with ethernet firmware")
BAREBOX_CMD_GROUP(CMD_GRP_NET)
BAREBOX_CMD_END
-
diff --git a/arch/arm/mach-omap/boot_order.c b/arch/arm/mach-omap/boot_order.c
index 4af86e6..db22513 100644
--- a/arch/arm/mach-omap/boot_order.c
+++ b/arch/arm/mach-omap/boot_order.c
@@ -69,15 +69,15 @@ static int cmd_boot_order(int argc, char *argv[])
return 0;
}
-static const __maybe_unused char cmd_boot_order_help[] =
-"Usage: boot_order []\n"
-"Set warm boot order of up to four devices.\n"
-"Each device can be one of:\n"
-"xip xipwait nand onenand mmc1 mmc2_1 mmc2_2 uart usb_1 usb_ulpi usb_2\n";
+BAREBOX_CMD_HELP_START(boot_order)
+BAREBOX_CMD_HELP_TEXT("Set warm boot order of up to four devices. Each device can be one of:")
+BAREBOX_CMD_HELP_TEXT("xip xipwait nand onenand mmc1 mmc2_1 mmc2_2 uart usb_1 usb_ulpi usb_2")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(boot_order)
.cmd = cmd_boot_order,
- .usage = "boot_order []",
+ BAREBOX_CMD_DESC("set warm boot order")
+ BAREBOX_CMD_OPTS("DEVICE...")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_boot_order_help)
BAREBOX_CMD_COMPLETE(empty_complete)
diff --git a/arch/blackfin/boards/ipe337/cmd_alternate.c b/arch/blackfin/boards/ipe337/cmd_alternate.c
index aee9560..992d274 100644
--- a/arch/blackfin/boards/ipe337/cmd_alternate.c
+++ b/arch/blackfin/boards/ipe337/cmd_alternate.c
@@ -44,14 +44,9 @@ static int do_alternate(int argc, char *argv[])
return (bitcount & 1) ? 3 : 2;
}
-static const __maybe_unused char cmd_alternate_help[] =
-"Usage: alternate "
-"\n";
-
BAREBOX_CMD_START(alternate)
.cmd = do_alternate,
- .usage = "count zero bits in a file",
+ BAREBOX_CMD_DESC("count zero bits in a file")
+ BAREBOX_CMD_OPTS("FILE")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
- BAREBOX_CMD_HELP(cmd_alternate_help)
BAREBOX_CMD_END
-
diff --git a/arch/mips/lib/cpuinfo.c b/arch/mips/lib/cpuinfo.c
index b541f70..1b17169 100644
--- a/arch/mips/lib/cpuinfo.c
+++ b/arch/mips/lib/cpuinfo.c
@@ -54,6 +54,6 @@ static int do_cpuinfo(int argc, char *argv[])
BAREBOX_CMD_START(cpuinfo)
.cmd = do_cpuinfo,
- .usage = "Show info about CPU",
+ BAREBOX_CMD_DESC("show CPU information")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
BAREBOX_CMD_END
diff --git a/arch/openrisc/lib/cpuinfo.c b/arch/openrisc/lib/cpuinfo.c
index 2a055aa..32fb47d 100644
--- a/arch/openrisc/lib/cpuinfo.c
+++ b/arch/openrisc/lib/cpuinfo.c
@@ -148,6 +148,6 @@ static int do_cpuinfo(int argc, char *argv[])
BAREBOX_CMD_START(cpuinfo)
.cmd = do_cpuinfo,
- .usage = "Show info about CPU",
+ BAREBOX_CMD_DESC("show CPU information")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
BAREBOX_CMD_END
diff --git a/commands/2048.c b/commands/2048.c
index 6d4f927..26c9e6c 100644
--- a/commands/2048.c
+++ b/commands/2048.c
@@ -378,13 +378,13 @@ static int do_2048(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(2048)
-BAREBOX_CMD_HELP_USAGE("2048\n")
-BAREBOX_CMD_HELP_SHORT("The 2048 game\n")
+BAREBOX_CMD_HELP_TEXT("Use your arrow keys to move the tiles. When two tiles with")
+BAREBOX_CMD_HELP_TEXT("the same number touch, they merge into one!")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(2048)
.cmd = do_2048,
- .usage = "Usage: 2048",
+ BAREBOX_CMD_DESC("the 2048 game")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_2048_help)
BAREBOX_CMD_END
diff --git a/commands/automount.c b/commands/automount.c
index d1e5cb0..0afe4d2 100644
--- a/commands/automount.c
+++ b/commands/automount.c
@@ -57,16 +57,16 @@ static int do_automount(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(automount)
-BAREBOX_CMD_HELP_USAGE("automount [OPTIONS] \n")
-BAREBOX_CMD_HELP_SHORT("execute when is first accessed\n")
-BAREBOX_CMD_HELP_OPT("-l", "List currently registered automountpoints\n")
-BAREBOX_CMD_HELP_OPT("-d", "Create the mount path\n")
-BAREBOX_CMD_HELP_OPT("-r ", "remove an automountpoint\n")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-l", "list registered automount-points")
+BAREBOX_CMD_HELP_OPT("-d", "create the mount directory")
+BAREBOX_CMD_HELP_OPT("-r", "remove an automountpoint")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(automount)
.cmd = do_automount,
- .usage = "automount [OPTIONS] ",
+ BAREBOX_CMD_DESC("execute (mount) COMMAND when PATH ist first accessed")
+ BAREBOX_CMD_OPTS("[-ldr] PATH [COMMAND]")
BAREBOX_CMD_GROUP(CMD_GRP_PART)
BAREBOX_CMD_HELP(cmd_automount_help)
BAREBOX_CMD_END
diff --git a/commands/barebox-update.c b/commands/barebox-update.c
index 819bf4d..a24dc3e 100644
--- a/commands/barebox-update.c
+++ b/commands/barebox-update.c
@@ -69,19 +69,18 @@ static int do_barebox_update(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(barebox_update)
-BAREBOX_CMD_HELP_USAGE("barebox_update [OPTIONS] \n")
-BAREBOX_CMD_HELP_SHORT("Update barebox to persistent media\n")
-BAREBOX_CMD_HELP_OPT("-t ", "\n")
-BAREBOX_CMD_HELP_OPT("-d ", "write image to instead of handler default\n")
-BAREBOX_CMD_HELP_OPT(" ", "Can be used for debugging purposes (-d /tmpfile)\n")
-BAREBOX_CMD_HELP_OPT("-y\t", "yes. Do not ask for confirmation\n")
-BAREBOX_CMD_HELP_OPT("-f ", "Set force level\n")
-BAREBOX_CMD_HELP_OPT("-l\t", "list registered targets\n")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-l\t", "list registered targets")
+BAREBOX_CMD_HELP_OPT("-t TARGET", "specify data target handler name")
+BAREBOX_CMD_HELP_OPT("-d DEVICE", "write image to DEVICE")
+BAREBOX_CMD_HELP_OPT("-y\t", "autom. use 'yes' when asking confirmations")
+BAREBOX_CMD_HELP_OPT("-f LEVEL", "set force level")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(barebox_update)
.cmd = do_barebox_update,
- .usage = "update barebox",
+ BAREBOX_CMD_DESC("update barebox to persistent media")
+ BAREBOX_CMD_OPTS("[-ltdyf] [IMAGE]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_barebox_update_help)
BAREBOX_CMD_END
diff --git a/commands/basename.c b/commands/basename.c
index 835c299..00daa5f 100644
--- a/commands/basename.c
+++ b/commands/basename.c
@@ -36,13 +36,13 @@ static int do_basename(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(basename)
-BAREBOX_CMD_HELP_USAGE("basename NAME BASENAME\n")
-BAREBOX_CMD_HELP_SHORT("strip NAME and store into $BASENAME\n")
+BAREBOX_CMD_HELP_TEXT("Remove directory part from the PATH and store result into variable VAR.")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(basename)
.cmd = do_basename,
- .usage = "strip directory and suffix from filenames",
+ BAREBOX_CMD_DESC("strip directory and suffix from filenames")
+ BAREBOX_CMD_OPTS("PATH VAR")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_basename_help)
BAREBOX_CMD_END
diff --git a/commands/boot.c b/commands/boot.c
index 1b88ffe..7a956a2 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -457,30 +457,34 @@ out:
}
BAREBOX_CMD_HELP_START(boot)
-BAREBOX_CMD_HELP_USAGE("boot [OPTIONS] [BOOTSRC...]\n")
-BAREBOX_CMD_HELP_SHORT("Boot an operating system.\n")
-BAREBOX_CMD_HELP_SHORT("[BOOTSRC...] can be:\n")
-BAREBOX_CMD_HELP_SHORT("- a filename under /env/boot/\n")
-BAREBOX_CMD_HELP_SHORT("- a full path to a boot script\n")
-BAREBOX_CMD_HELP_SHORT("- a device name\n")
-BAREBOX_CMD_HELP_SHORT("- a partition name under /dev/\n")
-BAREBOX_CMD_HELP_SHORT("- a full path to a directory which\n")
-BAREBOX_CMD_HELP_SHORT(" - contains boot scripts, or\n")
-BAREBOX_CMD_HELP_SHORT(" - contains a loader/entries/ directory containing bootspec entries\n")
-BAREBOX_CMD_HELP_SHORT("\n")
-BAREBOX_CMD_HELP_SHORT("Multiple bootsources may be given which are probed in order until\n")
-BAREBOX_CMD_HELP_SHORT("one succeeds.\n")
-BAREBOX_CMD_HELP_SHORT("\nOptions:\n")
-BAREBOX_CMD_HELP_OPT ("-v","Increase verbosity\n")
-BAREBOX_CMD_HELP_OPT ("-d","Dryrun. See what happens but do no actually boot\n")
-BAREBOX_CMD_HELP_OPT ("-l","List available boot sources\n")
-BAREBOX_CMD_HELP_OPT ("-m","Show a menu with boot options\n")
-BAREBOX_CMD_HELP_OPT ("-t ","specify timeout for the menu\n")
+BAREBOX_CMD_HELP_TEXT("This is for booting based on scripts. Unlike the bootm command which")
+BAREBOX_CMD_HELP_TEXT("can boot a single image this command offers the possibility to boot with")
+BAREBOX_CMD_HELP_TEXT("scripts (by default placed under /env/boot/).")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("BOOTSRC can be:")
+BAREBOX_CMD_HELP_TEXT("- a filename under /env/boot/")
+BAREBOX_CMD_HELP_TEXT("- a full path to a boot script")
+BAREBOX_CMD_HELP_TEXT("- a device name")
+BAREBOX_CMD_HELP_TEXT("- a partition name under /dev/")
+BAREBOX_CMD_HELP_TEXT("- a full path to a directory which")
+BAREBOX_CMD_HELP_TEXT(" - contains boot scripts, or")
+BAREBOX_CMD_HELP_TEXT(" - contains a loader/entries/ directory containing bootspec entries")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Multiple bootsources may be given which are probed in order until")
+BAREBOX_CMD_HELP_TEXT("one succeeds.")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-v","Increase verbosity")
+BAREBOX_CMD_HELP_OPT ("-d","Dryrun. See what happens but do no actually boot")
+BAREBOX_CMD_HELP_OPT ("-l","List available boot sources")
+BAREBOX_CMD_HELP_OPT ("-m","Show a menu with boot options")
+BAREBOX_CMD_HELP_OPT ("-t SECS","specify timeout in SECS")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(boot)
.cmd = do_boot,
- .usage = "boot the machine",
+ BAREBOX_CMD_DESC("boot from script, device, ...")
+ BAREBOX_CMD_OPTS("[-vdlmt] [BOOTSRC...]")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_boot_help)
BAREBOX_CMD_END
diff --git a/commands/bootm.c b/commands/bootm.c
index af2cb69..5801f44 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -141,27 +141,38 @@ err_out:
}
BAREBOX_CMD_HELP_START(bootm)
-BAREBOX_CMD_HELP_USAGE("bootm [OPTIONS] image\n")
-BAREBOX_CMD_HELP_SHORT("Boot an application image.\n")
-BAREBOX_CMD_HELP_OPT ("-c", "crc check uImage data\n")
-BAREBOX_CMD_HELP_OPT ("-d", "dryrun. Check data, but do not run\n")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-c", "crc check uImage data")
+BAREBOX_CMD_HELP_OPT ("-d", "dryrun. Check data, but do not run")
#ifdef CONFIG_CMD_BOOTM_INITRD
-BAREBOX_CMD_HELP_OPT ("-r ","specify an initrd image\n")
-BAREBOX_CMD_HELP_OPT ("-L ","specify initrd load address\n")
+BAREBOX_CMD_HELP_OPT ("-r INITRD","specify an initrd image")
+BAREBOX_CMD_HELP_OPT ("-L ADDR","specify initrd load address")
#endif
-BAREBOX_CMD_HELP_OPT ("-a ","specify os load address\n")
-BAREBOX_CMD_HELP_OPT ("-e ","entry point to the image relative to start (0)\n")
+BAREBOX_CMD_HELP_OPT ("-a ADDR","specify os load address")
+BAREBOX_CMD_HELP_OPT ("-e OFFS","entry point to the image relative to start (0)")
#ifdef CONFIG_OFTREE
-BAREBOX_CMD_HELP_OPT ("-o ","specify oftree\n")
+BAREBOX_CMD_HELP_OPT ("-o DTS","specify device tree")
#endif
#ifdef CONFIG_CMD_BOOTM_VERBOSE
-BAREBOX_CMD_HELP_OPT ("-v","verbose\n")
+BAREBOX_CMD_HELP_OPT ("-v\t","verbose")
#endif
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(bootm)
.cmd = do_bootm,
- .usage = "boot an application image",
+ BAREBOX_CMD_DESC("boot an application image")
+ BAREBOX_CMD_OPTS("[-cd"
+#ifdef CONFIG_CMD_BOOTM_INITRD
+ "rL"
+#endif
+ "ae"
+#ifdef CONFIG_OFTREE
+ "o"
+#endif
+#ifdef CONFIG_CMD_BOOTM_VERBOSE
+ "v"
+#endif
+ "] IMAGE")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_bootm_help)
BAREBOX_CMD_END
diff --git a/commands/cat.c b/commands/cat.c
index f51af4e..c01710c 100644
--- a/commands/cat.c
+++ b/commands/cat.c
@@ -82,15 +82,13 @@ out:
}
BAREBOX_CMD_HELP_START(cat)
-BAREBOX_CMD_HELP_USAGE("cat [FILES]\n")
-BAREBOX_CMD_HELP_SHORT("Concatenate files on stdout.\n")
-BAREBOX_CMD_HELP_TEXT ("Currently only printable characters and \\ n and \\ t are printed,\n")
-BAREBOX_CMD_HELP_TEXT ("but this should be optional.\n")
+BAREBOX_CMD_HELP_TEXT("Currently only printable characters and NL, TAB are printed.")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(cat)
.cmd = do_cat,
- .usage = "concatenate file(s)",
+ BAREBOX_CMD_DESC("concatenate file(s) to stdout")
+ BAREBOX_CMD_OPTS("FILE...")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_cat_help)
BAREBOX_CMD_END
diff --git a/commands/cd.c b/commands/cd.c
index caa368d..5611e9a 100644
--- a/commands/cd.c
+++ b/commands/cd.c
@@ -45,14 +45,13 @@ static int do_cd(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(cd)
-BAREBOX_CMD_HELP_USAGE("cd [directory]\n")
-BAREBOX_CMD_HELP_SHORT("Change to directory.\n")
-BAREBOX_CMD_HELP_TEXT ("If called without an argument, change to the root directory /.\n")
+BAREBOX_CMD_HELP_TEXT("If called without an argument, change to the root directory '/'.")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(cd)
.cmd = do_cd,
- .usage = "change working directory",
+ BAREBOX_CMD_DESC("change working directory")
+ BAREBOX_CMD_OPTS("DIRECTORY")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_cd_help)
BAREBOX_CMD_END
diff --git a/commands/clear.c b/commands/clear.c
index a67ece8..3be2119 100644
--- a/commands/clear.c
+++ b/commands/clear.c
@@ -30,13 +30,13 @@ static int do_clear(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(clear)
-BAREBOX_CMD_HELP_USAGE("clear\n")
-BAREBOX_CMD_HELP_SHORT("Clear the screen.\n")
+BAREBOX_CMD_HELP_TEXT("Send ANSI ESC sequence to clear the screen.")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(clear)
.cmd = do_clear,
- .usage = "clear screen",
+ BAREBOX_CMD_DESC("clear screen")
BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE)
BAREBOX_CMD_COMPLETE(empty_complete)
+ BAREBOX_CMD_HELP(cmd_clear_help)
BAREBOX_CMD_END
diff --git a/commands/clk.c b/commands/clk.c
index 6718ae8..31f4e0d 100644
--- a/commands/clk.c
+++ b/commands/clk.c
@@ -18,14 +18,10 @@ static int do_clk_enable(int argc, char *argv[])
return clk_enable(clk);
}
-BAREBOX_CMD_HELP_START(clk_enable)
-BAREBOX_CMD_HELP_USAGE("clk_enable \n")
-BAREBOX_CMD_HELP_SHORT("enable \n")
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(clk_enable)
.cmd = do_clk_enable,
- .usage = "enable a clock",
+ BAREBOX_CMD_DESC("enable a clock")
+ BAREBOX_CMD_OPTS("CLK")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_clk_enable_help)
BAREBOX_CMD_END
@@ -46,14 +42,10 @@ static int do_clk_disable(int argc, char *argv[])
return 0;
}
-BAREBOX_CMD_HELP_START(clk_disable)
-BAREBOX_CMD_HELP_USAGE("clk_disable \n")
-BAREBOX_CMD_HELP_SHORT("disable \n")
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(clk_disable)
.cmd = do_clk_disable,
- .usage = "disable a clock",
+ BAREBOX_CMD_DESC("disable a clock")
+ BAREBOX_CMD_OPTS("CLK")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_clk_disable_help)
BAREBOX_CMD_END
@@ -76,13 +68,13 @@ static int do_clk_set_rate(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(clk_set_rate)
-BAREBOX_CMD_HELP_USAGE("clk_set_rate \n")
-BAREBOX_CMD_HELP_SHORT("Set clock to \n")
+BAREBOX_CMD_HELP_TEXT("Set clock CLK to RATE")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(clk_set_rate)
.cmd = do_clk_set_rate,
- .usage = "set a clocks rate",
+ BAREBOX_CMD_DESC("set a clocks rate")
+ BAREBOX_CMD_OPTS("CLK HZ")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_clk_set_rate_help)
BAREBOX_CMD_END
@@ -108,13 +100,14 @@ static int do_clk_dump(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(clk_dump)
-BAREBOX_CMD_HELP_USAGE("clk_dump [-v]\n")
-BAREBOX_CMD_HELP_OPT ("-v", "verbose\n")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-v", "verbose")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(clk_dump)
.cmd = do_clk_dump,
- .usage = "show information about registered clocks",
+ BAREBOX_CMD_DESC("show information about registered clocks")
+ BAREBOX_CMD_OPTS("[-v]")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
BAREBOX_CMD_HELP(cmd_clk_dump_help)
BAREBOX_CMD_END
@@ -136,14 +129,9 @@ static int do_clk_set_parent(int argc, char *argv[])
return clk_set_parent(clk, parent);
}
-BAREBOX_CMD_HELP_START(clk_set_parent)
-BAREBOX_CMD_HELP_USAGE("clk_set_parent \n")
-BAREBOX_CMD_HELP_SHORT("Set parent of to \n")
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(clk_set_parent)
.cmd = do_clk_set_parent,
- .usage = "set a parent of a clock",
+ BAREBOX_CMD_DESC("set parent of a clock")
+ BAREBOX_CMD_OPTS("CLK PARENT")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
- BAREBOX_CMD_HELP(cmd_clk_set_parent_help)
BAREBOX_CMD_END
diff --git a/commands/cp.c b/commands/cp.c
index 2a289f8..8ecde91 100644
--- a/commands/cp.c
+++ b/commands/cp.c
@@ -89,8 +89,10 @@ out:
}
BAREBOX_CMD_HELP_START(cp)
-BAREBOX_CMD_HELP_USAGE("cp [-v]
BAREBOX_CMD_START(linux16)
.cmd = do_linux16,
- .usage = "boot a linux kernel",
+ BAREBOX_CMD_DESC("boot a linux kernel on x86 via real-mode code")
+ BAREBOX_CMD_OPTS("[-v VESAMODE] FILE")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_linux16_help)
BAREBOX_CMD_END
diff --git a/commands/linux_exec.c b/commands/linux_exec.c
index a057fc5..741168a 100644
--- a/commands/linux_exec.c
+++ b/commands/linux_exec.c
@@ -45,14 +45,9 @@ static int do_linux_exec(int argc, char *argv[])
return 0;
}
-BAREBOX_CMD_HELP_START(linux_exec)
-BAREBOX_CMD_HELP_USAGE("linux_exec ...\n")
-BAREBOX_CMD_HELP_SHORT("Execute a command on the host\n")
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(linux_exec)
.cmd = do_linux_exec,
- .usage = "Execute a command on the host",
+ BAREBOX_CMD_DESC("execute a command on the host")
+ BAREBOX_CMD_OPTS("COMMAND")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
- BAREBOX_CMD_HELP(cmd_linux_exec_help)
BAREBOX_CMD_END
diff --git a/commands/ln.c b/commands/ln.c
index f622819..28e524e 100644
--- a/commands/ln.c
+++ b/commands/ln.c
@@ -39,14 +39,9 @@ static int do_ln(int argc, char *argv[])
return 0;
}
-BAREBOX_CMD_HELP_START(ln)
-BAREBOX_CMD_HELP_USAGE("ln SRC DEST\n")
-BAREBOX_CMD_HELP_SHORT("symlink - make a new name for a file\n")
-BAREBOX_CMD_HELP_END
-
BAREBOX_CMD_START(ln)
.cmd = do_ln,
- .usage = "symlink - make a new name for a file",
+ BAREBOX_CMD_DESC("create symlink (make a new name for a file)")
+ BAREBOX_CMD_OPTS("SRC DEST")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
- BAREBOX_CMD_HELP(cmd_ln_help)
BAREBOX_CMD_END
diff --git a/commands/loadb.c b/commands/loadb.c
index 6ff36dc..28eebf4 100644
--- a/commands/loadb.c
+++ b/commands/loadb.c
@@ -698,16 +698,19 @@ static int do_load_serial_bin(int argc, char *argv[])
return rcode;
}
-static const __maybe_unused char cmd_loadb_help[] =
- "[OPTIONS]\n"
- " -f file - where to download to - defaults to " DEF_FILE "\n"
- " -o offset - what offset to download - defaults to 0\n"
- " -b baud - baudrate at which to download - defaults to "
- "console baudrate\n"
- " -c - Create file if it is not present - default disabled";
+BAREBOX_CMD_HELP_START(loadb)
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default " DEF_FILE ")")
+BAREBOX_CMD_HELP_OPT("-o OFFS", "destination file OFFSet (default 0)")
+BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate")
+BAREBOX_CMD_HELP_OPT("-c", "create file if not present")
+BAREBOX_CMD_HELP_END
+
BAREBOX_CMD_START(loadb)
.cmd = do_load_serial_bin,
- .usage = "Load binary file over serial line (kermit mode)",
+ BAREBOX_CMD_DESC("load binary file over serial line (Kermit)")
+ BAREBOX_CMD_OPTS(" FILE")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_loadb_help)
BAREBOX_CMD_END
diff --git a/commands/loadenv.c b/commands/loadenv.c
index ef7ad13..ba92613 100644
--- a/commands/loadenv.c
+++ b/commands/loadenv.c
@@ -103,11 +103,13 @@ static int do_loadenv(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(loadenv)
-BAREBOX_CMD_HELP_USAGE("loadenv OPTIONS [ENVFS] [DIRECTORY]\n")
-BAREBOX_CMD_HELP_OPT("-n", "do not overwrite existing files\n")
-BAREBOX_CMD_HELP_OPT("-s", "scrub old environment\n")
-BAREBOX_CMD_HELP_OPT("-d", "load default environment\n")
-BAREBOX_CMD_HELP_SHORT("Load environment from ENVFS into DIRECTORY (default: /dev/env0 -> /env).\n")
+BAREBOX_CMD_HELP_TEXT("Load environment from files in ENVFS (default /dev/env0) in")
+BAREBOX_CMD_HELP_TEXT("DIRECTORY (default /env")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-n", "do not overwrite existing files")
+BAREBOX_CMD_HELP_OPT("-s", "scrub old environment")
+BAREBOX_CMD_HELP_OPT("-d", "load default environment")
BAREBOX_CMD_HELP_END
/**
@@ -121,7 +123,8 @@ ENVFS can only handle files, directories are skipped silently.
BAREBOX_CMD_START(loadenv)
.cmd = do_loadenv,
- .usage = "Load environment from ENVFS into DIRECTORY (default: /dev/env0 -> /env).",
+ BAREBOX_CMD_DESC("load environment from ENVFS")
+ BAREBOX_CMD_OPTS("{-nsd] [ENVFS] [DIRECTORY]")
BAREBOX_CMD_GROUP(CMD_GRP_ENV)
BAREBOX_CMD_HELP(cmd_loadenv_help)
BAREBOX_CMD_END
diff --git a/commands/loads.c b/commands/loads.c
index d67372b..24093e1 100644
--- a/commands/loads.c
+++ b/commands/loads.c
@@ -270,13 +270,14 @@ static int write_record(char *buf)
}
#endif /* CONFIG_CMD_SAVES */
-static const __maybe_unused char cmd_loads_help[] =
- "[ off ]\n"
- " - load S-Record file over serial line with offset 'off'\n";
+BAREBOX_CMD_HELP_START(loads)
+BAREBOX_CMD_HELP_TEXT("Load S-Record file over serial line with offset OFFS.")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(loads)
.cmd = do_load_serial,
- .usage = "load S-Record file over serial line",
+ BAREBOX_CMD_DESC("load binary file over serial line (S-Records)")
+ BAREBOX_CMD_OPTS("OFFS")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_loads_help)
BAREBOX_CMD_END
@@ -286,14 +287,14 @@ BAREBOX_CMD_END
*/
#ifdef CONFIG_CMD_SAVES
-static const __maybe_unused char cmd_saves_help[] =
- "[ off ] [size]\n"
- " - save S-Record file over serial line with offset 'off' "
- "and size 'size'\n";
+BAREBOX_CMD_HELP_START(saves)
+BAREBOX_CMD_HELP_TEXT("Save S-Record file to serial line with offset OFFS and length LEN.")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(saves)
.cmd = do_save_serial,
- .usage = "save S-Record file over serial line",
+ BAREBOX_CMD_DESC("save file over serial line (S-Records)")
+ BAREBOX_CMD_OPTS("OFFS LEN")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_saves_help)
BAREBOX_CMD_END
diff --git a/commands/loadxy.c b/commands/loadxy.c
index acc800b..0557951 100644
--- a/commands/loadxy.c
+++ b/commands/loadxy.c
@@ -140,6 +140,22 @@ static int do_loady(int argc, char *argv[])
return rcode;
}
+BAREBOX_CMD_HELP_START(loady)
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-g", "use Y-Modem/G (use on lossless tty such as USB)")
+BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate")
+BAREBOX_CMD_HELP_OPT("-t NAME", "console name to use (default: current)")
+BAREBOX_CMD_HELP_END
+
+BAREBOX_CMD_START(loady)
+ .cmd = do_loady,
+ BAREBOX_CMD_DESC("load binary file over serial line (Y-Modem)")
+ BAREBOX_CMD_OPTS("[-gtb]")
+ BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
+ BAREBOX_CMD_HELP(cmd_loady_help)
+BAREBOX_CMD_END
+
+
/**
* @brief provide the loadx(X-Modem) support
*
@@ -184,7 +200,7 @@ static int do_loadx(int argc, char *argv[])
else
cdev = console_get_first_active();
if (!cdev) {
- printf("%s:No console device %s with STDIN and STDOUT\n",
+ printf("%s:No console device %s with STDIN and STDOUT",
argv[0], cname ? cname : "default");
return -ENODEV;
}
@@ -224,32 +240,19 @@ static int do_loadx(int argc, char *argv[])
return rcode;
}
-static const __maybe_unused char cmd_loadx_help[] =
- "[OPTIONS]\n"
- " -f file - where to download to - defaults to " DEF_FILE "\n"
- " -o offset - what offset to download - defaults to 0\n"
- " -t name - console device name to use - defaults to current console\n"
- " -b baud - baudrate at which to download - defaults to console baudrate\n"
- " -c - Create file if it is not present - default disabled";
+BAREBOX_CMD_HELP_START(loadx)
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-f FILE", "download to FILE (default " DEF_FILE ")")
+BAREBOX_CMD_HELP_OPT("-o OFFS", "destination file OFFSet (default 0)")
+BAREBOX_CMD_HELP_OPT("-b BAUD", "baudrate for download (default: console baudrate")
+BAREBOX_CMD_HELP_OPT("-t NAME", "console name to use (default: current)")
+BAREBOX_CMD_HELP_OPT("-c", "create file if not present")
+BAREBOX_CMD_HELP_END
-#ifdef CONFIG_CMD_LOADY
BAREBOX_CMD_START(loadx)
.cmd = do_loadx,
- .usage = "Load binary file over serial line (X-Modem)",
- BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
-BAREBOX_CMD_HELP(cmd_loadx_help)
-BAREBOX_CMD_END
-
-static const __maybe_unused char cmd_loady_help[] =
- "[OPTIONS]\n"
- " -g - use Y-Modem/G (only for lossless tty as USB)\n"
- " -t name - console device name to use - defaults to current console\n"
- " -b baud - baudrate at which to download - defaults to console baudrate\n";
-
-BAREBOX_CMD_START(loady)
- .cmd = do_loady,
- .usage = "Load binary file over serial line (Y-Modem or Y-Modem/G)",
+ BAREBOX_CMD_DESC("load binary file over serial line (X-Modem)")
+ BAREBOX_CMD_OPTS("[-fptbc]")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
-BAREBOX_CMD_HELP(cmd_loady_help)
+ BAREBOX_CMD_HELP(cmd_loadx_help)
BAREBOX_CMD_END
-#endif
diff --git a/commands/login.c b/commands/login.c
index 35ab84a..210eb20 100644
--- a/commands/login.c
+++ b/commands/login.c
@@ -78,15 +78,19 @@ static int do_login(int argc, char *argv[])
return 0;
}
-static const __maybe_unused char cmd_login_help[] =
-"Usage: login [-t timeout []]\n"
-"If a timeout is specified and expired the command will be executed;\n"
-"\"boot\" by default\n"
-;
+BAREBOX_CMD_HELP_START(login)
+BAREBOX_CMD_HELP_TEXT("Asks for a password from the console before script execution continues.")
+BAREBOX_CMD_HELP_TEXT("The password can be set with the 'passwd' command. Instead of specifying")
+BAREBOX_CMD_HELP_TEXT("a TIMEOUT the magic variable 'global.login.timeout' could be set.")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-t TIMEOUT", "Execute COMMAND if no login withing TIMEOUT seconds")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(login)
.cmd = do_login,
- .usage = "login",
+ BAREBOX_CMD_DESC("ask for a password")
+ BAREBOX_CMD_OPTS("[-t TIMEOUT] COMMAND")
BAREBOX_CMD_GROUP(CMD_GRP_CONSOLE)
BAREBOX_CMD_HELP(cmd_login_help)
BAREBOX_CMD_COMPLETE(empty_complete)
diff --git a/commands/ls.c b/commands/ls.c
index 60bbfe3..3440790 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -204,14 +204,18 @@ static int do_ls(int argc, char *argv[])
}
BAREBOX_CMD_HELP_START(ls)
-BAREBOX_CMD_HELP_USAGE("ls [OPTIONS] [FILES]\n")
-BAREBOX_CMD_HELP_SHORT("List information about the FILEs (the current directory by default).\n")
-BAREBOX_CMD_HELP_OPT ("-R", "list subdirectories recursively\n")
+BAREBOX_CMD_HELP_TEXT("List information about the specified files or directories.")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-l", "long format")
+BAREBOX_CMD_HELP_OPT ("-C", "column format (opposite of long format)")
+BAREBOX_CMD_HELP_OPT ("-R", "list subdirectories recursively")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(ls)
.cmd = do_ls,
- .usage = "list a file or directory",
+ BAREBOX_CMD_DESC("list a file or directory")
+ BAREBOX_CMD_OPTS("[-lCR] [FILEDIR...]")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_ls_help)
BAREBOX_CMD_END
diff --git a/commands/lsmod.c b/commands/lsmod.c
index 751ecfe..711c1c6 100644
--- a/commands/lsmod.c
+++ b/commands/lsmod.c
@@ -15,7 +15,7 @@ static int do_lsmod(int argc, char *argv[])
BAREBOX_CMD_START(lsmod)
.cmd = do_lsmod,
- .usage = "list modules",
+ BAREBOX_CMD_DESC("list loaded barebox modules")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/magicvar.c b/commands/magicvar.c
index 8f93227..d92788a 100644
--- a/commands/magicvar.c
+++ b/commands/magicvar.c
@@ -16,6 +16,6 @@ static int do_magicvar(int argc, char *argv[])
BAREBOX_CMD_START(magicvar)
.cmd = do_magicvar,
- .usage = "List information about magic variables",
+ BAREBOX_CMD_DESC("list information about magic variables")
BAREBOX_CMD_GROUP(CMD_GRP_ENV)
BAREBOX_CMD_END
diff --git a/commands/md.c b/commands/md.c
index e5eb705..c1361a6 100644
--- a/commands/md.c
+++ b/commands/md.c
@@ -89,29 +89,28 @@ out:
return ret ? 1 : 0;
}
-static const __maybe_unused char cmd_md_help[] =
-"Usage md [OPTIONS] \n"
-"display (hexdump) a memory region.\n"
-"options:\n"
-" -s display file (default /dev/mem)\n"
-" -b output in bytes\n"
-" -w output in halfwords (16bit)\n"
-" -l output in words (32bit)\n"
-" -x swap bytes at output\n"
-"\n"
-"Memory regions:\n"
-"Memory regions can be specified in two different forms: start+size\n"
-"or start-end, If is omitted it defaults to 0. If end is omitted it\n"
-"defaults to the end of the device, except for interactive commands like md\n"
-"and mw for which it defaults to 0x100.\n"
-"Sizes can be specified as decimal, or if prefixed with 0x as hexadecimal.\n"
-"an optional suffix of k, M or G is for kibibytes, Megabytes or Gigabytes,\n"
-"respectively\n";
+
+BAREBOX_CMD_HELP_START(md)
+BAREBOX_CMD_HELP_TEXT("Display (hex dump) a memory region.")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-b", "byte access")
+BAREBOX_CMD_HELP_OPT ("-w", "word access (16 bit)")
+BAREBOX_CMD_HELP_OPT ("-l", "long access (32 bit)")
+BAREBOX_CMD_HELP_OPT ("-s FILE", "display file (default /dev/mem)")
+BAREBOX_CMD_HELP_OPT ("-x", "swap bytes at output")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Memory regions can be specified in two different forms: START+SIZE")
+BAREBOX_CMD_HELP_TEXT("or START-END, If START is omitted it defaults to 0x100")
+BAREBOX_CMD_HELP_TEXT("Sizes can be specified as decimal, or if prefixed with 0x as hexadecimal.")
+BAREBOX_CMD_HELP_TEXT("An optional suffix of k, M or G is for kbytes, Megabytes or Gigabytes.")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(md)
.cmd = do_mem_md,
- .usage = "memory display",
+ BAREBOX_CMD_DESC("memory display")
+ BAREBOX_CMD_OPTS("[-bwlsx] REGION")
BAREBOX_CMD_GROUP(CMD_GRP_MEM)
BAREBOX_CMD_HELP(cmd_md_help)
BAREBOX_CMD_END
diff --git a/commands/memcmp.c b/commands/memcmp.c
index ea178c9..d048150 100644
--- a/commands/memcmp.c
+++ b/commands/memcmp.c
@@ -128,22 +128,24 @@ out:
return ret;
}
-static const __maybe_unused char cmd_memcmp_help[] =
-"Usage: memcmp [OPTIONS] \n"
-"\n"
-"options:\n"
-" -b, -w, -l use byte, halfword, or word accesses\n"
-" -s source file (default /dev/mem)\n"
-" -d destination file (default /dev/mem)\n"
-"\n"
-"Compare memory regions specified with addr1 and addr2\n"
-"of size bytes. If source is a file count can\n"
-"be left unspecified in which case the whole file is\n"
-"compared\n";
+BAREBOX_CMD_HELP_START(memcmp)
+BAREBOX_CMD_HELP_TEXT("Compare memory regions specified with ADDR and ADDR2")
+BAREBOX_CMD_HELP_TEXT("of size COUNT bytes. If source is a file COUNT can")
+BAREBOX_CMD_HELP_TEXT("be left unspecified, in which case the whole file is")
+BAREBOX_CMD_HELP_TEXT("compared.")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-b", "byte access")
+BAREBOX_CMD_HELP_OPT ("-w", "word access (16 bit)")
+BAREBOX_CMD_HELP_OPT ("-l", "long access (32 bit)")
+BAREBOX_CMD_HELP_OPT ("-s FILE", "source file (default /dev/mem)")
+BAREBOX_CMD_HELP_OPT ("-d FILE", "destination file (default /dev/mem)")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(memcmp)
.cmd = do_memcmp,
- .usage = "memory compare",
+ BAREBOX_CMD_DESC("memory compare")
+ BAREBOX_CMD_OPTS("[-bwlsd] ADDR1 ADDR2 COUNT")
BAREBOX_CMD_GROUP(CMD_GRP_MEM)
BAREBOX_CMD_HELP(cmd_memcmp_help)
BAREBOX_CMD_END
diff --git a/commands/memcpy.c b/commands/memcpy.c
index 5a791b0..78716b1 100644
--- a/commands/memcpy.c
+++ b/commands/memcpy.c
@@ -128,19 +128,21 @@ out:
return ret;
}
-static const __maybe_unused char cmd_memcpy_help[] =
-"Usage: memcpy [OPTIONS] \n"
-"\n"
-"options:\n"
-" -b, -w, -l use byte, halfword, or word accesses\n"
-" -s source file (default /dev/mem)\n"
-" -d destination file (default /dev/mem)\n"
-"\n"
-"Copy memory at of bytes to \n";
+BAREBOX_CMD_HELP_START(memcpy)
+BAREBOX_CMD_HELP_TEXT("Copy memory at SRC of COUNT bytes to DEST")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-b", "byte access")
+BAREBOX_CMD_HELP_OPT ("-w", "word access (16 bit)")
+BAREBOX_CMD_HELP_OPT ("-l", "long access (32 bit)")
+BAREBOX_CMD_HELP_OPT ("-s FILE", "source file (default /dev/mem)")
+BAREBOX_CMD_HELP_OPT ("-d FILE", "write file (default /dev/mem)")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(memcpy)
.cmd = do_memcpy,
- .usage = "memory copy",
+ BAREBOX_CMD_DESC("memory copy")
+ BAREBOX_CMD_OPTS("[-bwlsd] SRC DEST COUNT")
BAREBOX_CMD_GROUP(CMD_GRP_MEM)
BAREBOX_CMD_HELP(cmd_memcpy_help)
BAREBOX_CMD_END
diff --git a/commands/meminfo.c b/commands/meminfo.c
index a73c462..87c76fc 100644
--- a/commands/meminfo.c
+++ b/commands/meminfo.c
@@ -30,7 +30,7 @@ static int do_meminfo(int argc, char *argv[])
BAREBOX_CMD_START(meminfo)
.cmd = do_meminfo,
- .usage = "print info about memory usage",
+ BAREBOX_CMD_DESC("print info about memory usage")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
BAREBOX_CMD_COMPLETE(empty_complete)
BAREBOX_CMD_END
diff --git a/commands/memset.c b/commands/memset.c
index d557b9e..f869306 100644
--- a/commands/memset.c
+++ b/commands/memset.c
@@ -85,18 +85,20 @@ out:
return ret;
}
-static const __maybe_unused char cmd_memset_help[] =
-"Usage: memset [OPTIONS] \n"
-"\n"
-"options:\n"
-" -b, -w, -l use byte, halfword, or word accesses\n"
-" -d destination file (default /dev/mem)\n"
-"\n"
-"Fill the first bytes at offset with byte \n";
+BAREBOX_CMD_HELP_START(memset)
+BAREBOX_CMD_HELP_TEXT("Fills the first COUNT bytes at offset ADDR with byte DATA,")
+BAREBOX_CMD_HELP_TEXT("")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT ("-b", "byte access")
+BAREBOX_CMD_HELP_OPT ("-w", "word access (16 bit)")
+BAREBOX_CMD_HELP_OPT ("-l", "long access (32 bit)")
+BAREBOX_CMD_HELP_OPT ("-d FILE", "write file (default /dev/mem)")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(memset)
.cmd = do_memset,
- .usage = "memory fill",
+ BAREBOX_CMD_DESC("memory fill")
+ BAREBOX_CMD_OPTS("[-bwld] ADDR COUNT DATA")
BAREBOX_CMD_GROUP(CMD_GRP_MEM)
BAREBOX_CMD_HELP(cmd_memset_help)
BAREBOX_CMD_END
diff --git a/commands/memtest.c b/commands/memtest.c
index 8308c6c..c1ffc64 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -230,15 +230,17 @@ out:
return 0;
}
-static const __maybe_unused char cmd_memtest_help[] =
-"Usage: memtest [OPTION]...\n"
-"memtest related commands\n"
-" -i iterations [default=1, endless=0].\n"
-" -b perform only a test on buslines.";
+
+BAREBOX_CMD_HELP_START(memtest)
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-i ITERATIONS", "perform number of iterations (default 1, 0 is endless)")
+BAREBOX_CMD_HELP_OPT("-b", "perform only a test on bus lines")
+BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(memtest)
.cmd = do_memtest,
- .usage = "Memory Test",
+ BAREBOX_CMD_DESC("extensive memory test")
+ BAREBOX_CMD_OPTS("[-ib]")
BAREBOX_CMD_GROUP(CMD_GRP_MEM)
BAREBOX_CMD_HELP(cmd_memtest_help)
BAREBOX_CMD_END
diff --git a/commands/menu.c b/commands/menu.c
index 99cb7cb..2008aa5 100644
--- a/commands/menu.c
+++ b/commands/menu.c
@@ -407,71 +407,67 @@ end:
}
static const __maybe_unused char cmd_menu_help[] =
-"Usage: menu [OPTION]... \n"
-"Manage Menu\n"
+"Manage Menu:\n"
" -m menu\n"
" -l list\n"
" -s show\n"
#if defined(CONFIG_CMD_MENU_MANAGEMENT)
-"Advanced\n"
+"Advanced menu management:\n"
" -e menu entry\n"
" -a add\n"
" -r remove\n"
" -S select\n"
#endif
"\n"
-"How to\n"
-"\n"
-"Show menu\n"
+"Show menu:\n"
" (-A auto select delay)\n"
" (-d auto select description)\n"
-" menu -s -m