From 7ccc0543dc25cd5751f500dd58df766d61b43095 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 11 Jan 2016 14:31:20 +0100 Subject: [PATCH] btrfs-progs: cleanup, move usage help strings closer to the command callbacks Signed-off-by: David Sterba --- cmds-inspect.c | 16 +++++++------- cmds-property.c | 58 ++++++++++++++++++++++++------------------------- cmds-rescue.c | 18 +++++++-------- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/cmds-inspect.c b/cmds-inspect.c index c2bb862d..932765ba 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -329,6 +329,14 @@ out: return !!ret; } +static const char* const cmd_inspect_min_dev_size_usage[] = { + "btrfs inspect-internal min-dev-size [options] ", + "Get the minimum size the device can be shrunk to. The", + "device id 1 is used by default.", + "--id DEVID specify the device id to query", + NULL +}; + struct dev_extent_elem { u64 start; /* inclusive end */ @@ -569,14 +577,6 @@ out: return ret; } -static const char* const cmd_inspect_min_dev_size_usage[] = { - "btrfs inspect-internal min-dev-size [options] ", - "Get the minimum size the device can be shrunk to. The", - "device id 1 is used by default.", - "--id DEVID specify the device id to query", - NULL -}; - static int cmd_inspect_min_dev_size(int argc, char **argv) { int ret; diff --git a/cmds-property.c b/cmds-property.c index 9ca2abbd..b7b24841 100644 --- a/cmds-property.c +++ b/cmds-property.c @@ -32,35 +32,6 @@ static const char * const property_cmd_group_usage[] = { NULL }; -static const char * const cmd_property_get_usage[] = { - "btrfs property get [-t ] []", - "Gets a property from a btrfs object.", - "If no name is specified, all properties for the given object are", - "printed.", - "A filesystem object can be a the filesystem itself, a subvolume,", - "an inode or a device. The '-t ' option can be used to explicitly", - "specify what type of object you meant. This is only needed when a", - "property could be set for more then one object type. Possible types", - "are s[ubvol], f[ilesystem], i[node] and d[evice].", - NULL -}; - -static const char * const cmd_property_set_usage[] = { - "btrfs property set [-t ] ", - "Sets a property on a btrfs object.", - "Please see the help of 'btrfs property get' for a description of", - "objects and object types.", - NULL -}; - -static const char * const cmd_property_list_usage[] = { - "btrfs property list [-t ] ", - "Lists available properties with their descriptions for the given object.", - "Please see the help of 'btrfs property get' for a description of", - "objects and object types.", - NULL -}; - static int parse_prop(const char *arg, const struct prop_handler *props, const struct prop_handler **prop_ret) { @@ -388,6 +359,19 @@ static void parse_args(int argc, char **argv, } } +static const char * const cmd_property_get_usage[] = { + "btrfs property get [-t ] []", + "Gets a property from a btrfs object.", + "If no name is specified, all properties for the given object are", + "printed.", + "A filesystem object can be a the filesystem itself, a subvolume,", + "an inode or a device. The '-t ' option can be used to explicitly", + "specify what type of object you meant. This is only needed when a", + "property could be set for more then one object type. Possible types", + "are s[ubvol], f[ilesystem], i[node] and d[evice].", + NULL +}; + static int cmd_property_get(int argc, char **argv) { int ret; @@ -413,6 +397,14 @@ static int cmd_property_get(int argc, char **argv) return ret; } +static const char * const cmd_property_set_usage[] = { + "btrfs property set [-t ] ", + "Sets a property on a btrfs object.", + "Please see the help of 'btrfs property get' for a description of", + "objects and object types.", + NULL +}; + static int cmd_property_set(int argc, char **argv) { int ret; @@ -436,6 +428,14 @@ static int cmd_property_set(int argc, char **argv) return ret; } +static const char * const cmd_property_list_usage[] = { + "btrfs property list [-t ] ", + "Lists available properties with their descriptions for the given object.", + "Please see the help of 'btrfs property get' for a description of", + "objects and object types.", + NULL +}; + static int cmd_property_list(int argc, char **argv) { int ret; diff --git a/cmds-rescue.c b/cmds-rescue.c index 0dbff2dc..98954254 100644 --- a/cmds-rescue.c +++ b/cmds-rescue.c @@ -43,15 +43,6 @@ static const char * const cmd_rescue_chunk_recover_usage[] = { NULL }; -static const char * const cmd_rescue_super_recover_usage[] = { - "btrfs rescue super-recover [options] ", - "Recover bad superblocks from good copies", - "", - "-y Assume an answer of `yes' to all questions", - "-v Verbose mode", - NULL -}; - static int cmd_rescue_chunk_recover(int argc, char *argv[]) { int ret = 0; @@ -103,6 +94,15 @@ static int cmd_rescue_chunk_recover(int argc, char *argv[]) return ret; } +static const char * const cmd_rescue_super_recover_usage[] = { + "btrfs rescue super-recover [options] ", + "Recover bad superblocks from good copies", + "", + "-y Assume an answer of `yes' to all questions", + "-v Verbose mode", + NULL +}; + /* * return codes: * 0 : All superblocks are valid, no need to recover