btrfs-progs: fix helpinfo formats, short and options separation

For options that do not have the long description, the empty string is
required to mark where the options start. Some commands were missing
that.

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2019-06-21 15:36:04 +02:00
parent c8bea2b84b
commit add5079974
11 changed files with 14 additions and 5 deletions

View File

@ -237,8 +237,8 @@ static int _cmd_device_remove(const struct cmd_struct *cmd,
static const char * const cmd_device_remove_usage[] = { static const char * const cmd_device_remove_usage[] = {
"btrfs device remove <device>|<devid> [<device>|<devid>...] <path>", "btrfs device remove <device>|<devid> [<device>|<devid>...] <path>",
"Remove a device from a filesystem", "Remove a device from a filesystem",
"",
COMMON_USAGE_REMOVE_DELETE, COMMON_USAGE_REMOVE_DELETE,
"",
NULL NULL
}; };
@ -252,8 +252,8 @@ static DEFINE_SIMPLE_COMMAND(device_remove, "remove");
static const char * const cmd_device_delete_usage[] = { static const char * const cmd_device_delete_usage[] = {
"btrfs device delete <device>|<devid> [<device>|<devid>...] <path>", "btrfs device delete <device>|<devid> [<device>|<devid>...] <path>",
"Remove a device from a filesystem (alias of \"btrfs device remove\")", "Remove a device from a filesystem (alias of \"btrfs device remove\")",
"",
COMMON_USAGE_REMOVE_DELETE, COMMON_USAGE_REMOVE_DELETE,
"",
NULL NULL
}; };
@ -595,6 +595,7 @@ static DEFINE_SIMPLE_COMMAND(device_stats, "stats");
static const char * const cmd_device_usage_usage[] = { static const char * const cmd_device_usage_usage[] = {
"btrfs device usage [options] <path> [<path>..]", "btrfs device usage [options] <path> [<path>..]",
"Show detailed information about internal allocations in devices.", "Show detailed information about internal allocations in devices.",
"",
HELPINFO_UNITS_SHORT_LONG, HELPINFO_UNITS_SHORT_LONG,
NULL NULL
}; };

View File

@ -553,6 +553,7 @@ out:
static const char * const cmd_filesystem_du_usage[] = { static const char * const cmd_filesystem_du_usage[] = {
"btrfs filesystem du [options] <path> [<path>..]", "btrfs filesystem du [options] <path> [<path>..]",
"Summarize disk usage of each file.", "Summarize disk usage of each file.",
"",
"-s|--summarize display only a total for each argument", "-s|--summarize display only a total for each argument",
HELPINFO_UNITS_LONG, HELPINFO_UNITS_LONG,
NULL NULL

View File

@ -959,6 +959,7 @@ out:
static const char * const cmd_filesystem_usage_usage[] = { static const char * const cmd_filesystem_usage_usage[] = {
"btrfs filesystem usage [options] <path> [<path>..]", "btrfs filesystem usage [options] <path> [<path>..]",
"Show detailed information about internal filesystem usage .", "Show detailed information about internal filesystem usage .",
"",
HELPINFO_UNITS_SHORT_LONG, HELPINFO_UNITS_SHORT_LONG,
"-T show data in tabular format", "-T show data in tabular format",
NULL NULL

View File

@ -57,6 +57,7 @@ static const char * const filesystem_cmd_group_usage[] = {
static const char * const cmd_filesystem_df_usage[] = { static const char * const cmd_filesystem_df_usage[] = {
"btrfs filesystem df [options] <path>", "btrfs filesystem df [options] <path>",
"Show space usage information for a mount point", "Show space usage information for a mount point",
"",
HELPINFO_UNITS_SHORT_LONG, HELPINFO_UNITS_SHORT_LONG,
NULL NULL
}; };
@ -623,6 +624,7 @@ fail_out:
static const char * const cmd_filesystem_show_usage[] = { static const char * const cmd_filesystem_show_usage[] = {
"btrfs filesystem show [options] [<path>|<uuid>|<device>|label]", "btrfs filesystem show [options] [<path>|<uuid>|<device>|label]",
"Show the structure of a filesystem", "Show the structure of a filesystem",
"",
"-d|--all-devices show only disks under /dev containing btrfs filesystem", "-d|--all-devices show only disks under /dev containing btrfs filesystem",
"-m|--mounted show only mounted btrfs", "-m|--mounted show only mounted btrfs",
HELPINFO_UNITS_LONG, HELPINFO_UNITS_LONG,

View File

@ -508,6 +508,7 @@ static int load_and_dump_sb(char *filename, int fd, u64 sb_bytenr, int full,
static const char * const cmd_inspect_dump_super_usage[] = { static const char * const cmd_inspect_dump_super_usage[] = {
"btrfs inspect-internal dump-super [options] device [device...]", "btrfs inspect-internal dump-super [options] device [device...]",
"Dump superblock from a device in a textual form", "Dump superblock from a device in a textual form",
"",
"-f|--full print full superblock information, backup roots etc.", "-f|--full print full superblock information, backup roots etc.",
"-a|--all print information about all superblocks", "-a|--all print information about all superblocks",
"-s|--super <super> specify which copy to print out (values: 0, 1, 2)", "-s|--super <super> specify which copy to print out (values: 0, 1, 2)",

View File

@ -423,6 +423,7 @@ out:
static const char * const cmd_inspect_tree_stats_usage[] = { static const char * const cmd_inspect_tree_stats_usage[] = {
"btrfs inspect-internal tree-stats [options] <device>", "btrfs inspect-internal tree-stats [options] <device>",
"Print various stats for trees", "Print various stats for trees",
"",
"-b raw numbers in bytes", "-b raw numbers in bytes",
NULL NULL
}; };

View File

@ -128,6 +128,7 @@ static DEFINE_SIMPLE_COMMAND(inspect_inode_resolve, "inode-resolve");
static const char * const cmd_inspect_logical_resolve_usage[] = { static const char * const cmd_inspect_logical_resolve_usage[] = {
"btrfs inspect-internal logical-resolve [-Pv] [-s bufsize] <logical> <path>", "btrfs inspect-internal logical-resolve [-Pv] [-s bufsize] <logical> <path>",
"Get file system paths for the given logical address", "Get file system paths for the given logical address",
"",
"-P skip the path resolving and print the inodes instead", "-P skip the path resolving and print the inodes instead",
"-v verbose mode", "-v verbose mode",
"-s bufsize set inode container's size. This is used to increase inode", "-s bufsize set inode container's size. This is used to increase inode",
@ -354,6 +355,7 @@ static const char* const cmd_inspect_min_dev_size_usage[] = {
"btrfs inspect-internal min-dev-size [options] <path>", "btrfs inspect-internal min-dev-size [options] <path>",
"Get the minimum size the device can be shrunk to. The", "Get the minimum size the device can be shrunk to. The",
"device id 1 is used by default.", "device id 1 is used by default.",
"",
"--id DEVID specify the device id to query", "--id DEVID specify the device id to query",
NULL NULL
}; };

View File

@ -271,6 +271,7 @@ static DEFINE_SIMPLE_COMMAND(qgroup_destroy, "destroy");
static const char * const cmd_qgroup_show_usage[] = { static const char * const cmd_qgroup_show_usage[] = {
"btrfs qgroup show [options] <path>", "btrfs qgroup show [options] <path>",
"Show subvolume quota groups.", "Show subvolume quota groups.",
"",
"-p print parent qgroup id", "-p print parent qgroup id",
"-c print child qgroup id", "-c print child qgroup id",
"-r print limit of referenced size of qgroup", "-r print limit of referenced size of qgroup",

View File

@ -158,7 +158,6 @@ static DEFINE_SIMPLE_COMMAND(rescue_super_recover, "super-recover");
static const char * const cmd_rescue_zero_log_usage[] = { static const char * const cmd_rescue_zero_log_usage[] = {
"btrfs rescue zero-log <device>", "btrfs rescue zero-log <device>",
"Clear the tree log. Usable if it's corrupted and prevents mount.", "Clear the tree log. Usable if it's corrupted and prevents mount.",
"",
NULL NULL
}; };
@ -214,7 +213,6 @@ static DEFINE_SIMPLE_COMMAND(rescue_zero_log, "zero-log");
static const char * const cmd_rescue_fix_device_size_usage[] = { static const char * const cmd_rescue_fix_device_size_usage[] = {
"btrfs rescue fix-device-size <device>", "btrfs rescue fix-device-size <device>",
"Re-align device and super block sizes. Usable if newer kernel refuse to mount it due to mismatch super size", "Re-align device and super block sizes. Usable if newer kernel refuse to mount it due to mismatch super size",
"",
NULL NULL
}; };

View File

@ -442,7 +442,7 @@ static const char * const cmd_send_usage[] = {
"'-p <parent>' option when '-c <clone-src>' options are given, in", "'-p <parent>' option when '-c <clone-src>' options are given, in",
"which case 'btrfs send' will determine a suitable parent among the", "which case 'btrfs send' will determine a suitable parent among the",
"clone sources itself.", "clone sources itself.",
"\n", "",
"-e If sending multiple subvols at once, use the new", "-e If sending multiple subvols at once, use the new",
" format and omit the end-cmd between the subvols.", " format and omit the end-cmd between the subvols.",
"-p <parent> Send an incremental stream from <parent> to", "-p <parent> Send an incremental stream from <parent> to",

View File

@ -928,6 +928,7 @@ static DEFINE_SIMPLE_COMMAND(subvol_find_new, "find-new");
static const char * const cmd_subvol_show_usage[] = { static const char * const cmd_subvol_show_usage[] = {
"btrfs subvolume show [options] <path>", "btrfs subvolume show [options] <path>",
"Show more information about the subvolume (UUIDs, generations, times, snapshots)", "Show more information about the subvolume (UUIDs, generations, times, snapshots)",
"",
"-r|--rootid rootid of the subvolume", "-r|--rootid rootid of the subvolume",
"-u|--uuid uuid of the subvolume", "-u|--uuid uuid of the subvolume",
HELPINFO_UNITS_SHORT_LONG, HELPINFO_UNITS_SHORT_LONG,