summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-11 14:31:20 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:02:53 +0100
commit7ccc0543dc25cd5751f500dd58df766d61b43095 (patch)
tree1213aedc421e40a81df74d96cf6c4f1eff112435
parentf7c9278008dcdc9fb7c754de89639758ebf6809e (diff)
btrfs-progs: cleanup, move usage help strings closer to the command callbacks
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-inspect.c16
-rw-r--r--cmds-property.c58
-rw-r--r--cmds-rescue.c18
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] <path>",
+ "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] <path>",
- "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 <type>] <object> [<name>]",
- "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 <type>' 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 <type>] <object> <name> <value>",
- "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 <type>] <object>",
- "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 <type>] <object> [<name>]",
+ "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 <type>' 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 <type>] <object> <name> <value>",
+ "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 <type>] <object>",
+ "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] <device>",
- "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] <device>",
+ "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