From 450f7e89116ed104f092dd1a709c0f057150a4f7 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Wed, 7 Feb 2018 21:40:13 +0530 Subject: create: support [storage ] option $ gluster-block help gluster-block (0.3) usage: gluster-block [] [--json*] commands: create [ha ] [auth ] [prealloc ] [storage ] create block device [defaults: ha 1, auth disable, prealloc no, size in bytes] [...] supported JSON formats: --json|--json-plain|--json-spaced|--json-pretty Fixes: #18 Change-Id: I5d9b4abb58596bd2297cffb294c6d31f752d53e9 Signed-off-by: Prasanna Kumar Kalever --- utils/utils.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'utils/utils.c') diff --git a/utils/utils.c b/utils/utils.c index 13d61cc..3f52134 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -49,6 +49,26 @@ glusterBlockCLIOptEnumParse(const char *opt) } +int +glusterBlockCLICreateOptEnumParse(const char *opt) +{ + int i; + + + if (!opt) { + return GB_CLI_CREATE_OPT_MAX; + } + + for (i = 0; i < GB_CLI_CREATE_OPT_MAX; i++) { + if (!strcmp(opt, gbCliCreateOptLookup[i])) { + return i; + } + } + + return i; +} + + int glusterBlockDaemonOptEnumParse(const char *opt) { -- cgit