summaryrefslogtreecommitdiff
path: root/lib/commands
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2014-07-02 13:16:32 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2014-07-04 15:40:17 +0200
commitda545ce3b471e76b3ebcfcb5528118d8dd9264df (patch)
tree11af8d46d787fdb9f9645bf6af52c08869e8eaef /lib/commands
parentd2af4f84c94cb8202565ac32c5f1df673cd92e0c (diff)
downloadlvm2-da545ce3b471e76b3ebcfcb5528118d8dd9264df.tar.gz
tools: add --binary arg to pvs,vgs,lvs and {pv,vg,lv}display -C and report/binary_values_as_numeric lvm.conf option
The --binary option, if used, causes all the binary values reported in reporting commands to be displayed as "0" or "1" instead of descriptive literal values (value "unknown" is still used for values that could not be determined). Also, add report/binary_values_as_numeric lvm.conf option with the same functionality as the --binary option (the --binary option prevails if both --binary cmd option and report/binary_values_as_numeric lvm.conf option is used at the same time). The report/binary_values_as_numeric is also profilable. This makes it easier to use and check lvm reporting command output in scripts.
Diffstat (limited to 'lib/commands')
-rw-r--r--lib/commands/toolcontext.c1
-rw-r--r--lib/commands/toolcontext.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 18fa12d15..6ac4a4212 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -297,6 +297,7 @@ int process_profilable_config(struct cmd_context *cmd) {
}
cmd->si_unit_consistency = find_config_tree_bool(cmd, global_si_unit_consistency_CFG, NULL);
+ cmd->report_binary_values_as_numeric = find_config_tree_bool(cmd, report_binary_values_as_numeric_CFG, NULL);
cmd->default_settings.suffix = find_config_tree_bool(cmd, global_suffix_CFG, NULL);
return 1;
diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h
index 9023a6cd9..162af5520 100644
--- a/lib/commands/toolcontext.h
+++ b/lib/commands/toolcontext.h
@@ -88,6 +88,7 @@ struct cmd_context {
unsigned partial_activation:1;
unsigned auto_set_activation_skip:1;
unsigned si_unit_consistency:1;
+ unsigned report_binary_values_as_numeric:1;
unsigned metadata_read_only:1;
unsigned ignore_clustered_vgs:1;
unsigned threaded:1; /* Set if running within a thread e.g. clvmd */