summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-02-22 14:49:55 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-02-24 14:58:50 +0530
commit9f1c8a5ba49e7cad67b7ebf6e3e119eeb32a7ff0 (patch)
tree4834de8c226e382c0d342be47b19badb17cf2c94 /utils
parentc1c22333819f744287fb78fb317ff70fa82beab8 (diff)
cli: change in synopsis for gluster-block commands
from now we will have fixed formats for commands. The new outfit will look like: $ gluster-block help gluster-block (3ba7ec5) usage: gluster-block <command> <volname[/blockname]> [<args>] commands: create <volname/blockname> [ha <count>] <host1[,host2,...]> <size> create block device. list <volname> list available block devices. info <volname/blockname> details about block device. delete <volname/blockname> delete block device. help show this message and exit. version show version info and exit. Example usage: $ gluster-block create volume/blockname 192.168.0.1 1GiB $ gluster-block create volume/blockname ha 2 192.168.0.1,192.168.0.2 1GiB $ gluster-block list volume $ gluster-block info volume/blockname $ gluster-block delete volume/blockname Change-Id: Idc6b55c26432ed1ac3f002c2a2b3dbb81b180ec2 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c42
-rw-r--r--utils/utils.h38
2 files changed, 0 insertions, 80 deletions
diff --git a/utils/utils.c b/utils/utils.c
index 3441e54..cb0e96e 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -34,48 +34,6 @@ glusterBlockCLIOptEnumParse(const char *opt)
int
-glusterBlockCLICreateOptEnumParse(const char *opt)
-{
- int i;
-
-
- if (!opt) {
- return GB_CLI_CREATE_OPT_MAX;
- }
-
- /* i = 11, enum start look gbCmdlineCreateOption */
- for (i = 11; i < GB_CLI_CREATE_OPT_MAX; i++) {
- if (!strcmp(opt, gbCmdlineCreateOptLookup[i])) {
- return i;
- }
- }
-
- return i;
-}
-
-
-int
-glusterBlockCLICommonOptEnumParse(const char *opt)
-{
- int i;
-
-
- if (!opt) {
- return GB_CLI_COMMON_OPT_MAX;
- }
-
- /* i = 21, enum start look gbCmdlineCreateOption */
- for (i = 21; i < GB_CLI_COMMON_OPT_MAX; i++) {
- if (!strcmp(opt, gbCmdlineCommonOptLookup[i])) {
- return i;
- }
- }
-
- return i;
-}
-
-
-int
blockMetaKeyEnumParse(const char *opt)
{
int i;
diff --git a/utils/utils.h b/utils/utils.h
index 77a6de0..3a0521e 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -184,25 +184,6 @@
gbFree(1 ? (void *) &(ptr) : (ptr))
-typedef enum gbCmdlineCreateOption {
- /* needed by create option */
- GB_CLI_CREATE_VOLUME = 11,
- GB_CLI_CREATE_SIZE = 12,
- GB_CLI_CREATE_MULTIPATH = 13,
- GB_CLI_CREATE_BACKEND_SERVESRS = 14,
-
- GB_CLI_CREATE_OPT_MAX
-} gbCmdlineCreateOption;
-
-
-typedef enum gbCmdlineCommonOption {
- /* common to all the cli options */
- GB_CLI_COMMON_VOLUME = 21,
-
- GB_CLI_COMMON_OPT_MAX
-} gbCmdlineCommonOption;
-
-
typedef enum gbCmdlineOption {
GB_CLI_UNKNOWN = 0,
@@ -232,21 +213,6 @@ static const char *const gbCmdlineOptLookup[] = {
[GB_CLI_OPT_MAX] = NULL,
};
-static const char *const gbCmdlineCreateOptLookup[] = {
- [GB_CLI_CREATE_VOLUME] = "volume",
- [GB_CLI_CREATE_SIZE] = "size",
- [GB_CLI_CREATE_MULTIPATH] = "mpath",
- [GB_CLI_CREATE_BACKEND_SERVESRS] = "servers",
-
-
- [GB_CLI_CREATE_OPT_MAX] = NULL
-};
-
-static const char *const gbCmdlineCommonOptLookup[] = {
- [GB_CLI_COMMON_VOLUME] = "volume",
-
- [GB_CLI_COMMON_OPT_MAX] = NULL
-};
typedef enum LogLevel {
GB_LOG_NONE = 0,
@@ -325,10 +291,6 @@ static const char *const MetaStatusLookup[] = {
int glusterBlockCLIOptEnumParse(const char *opt);
-int glusterBlockCLICreateOptEnumParse(const char *opt);
-
-int glusterBlockCLICommonOptEnumParse(const char *opt);
-
int blockMetaKeyEnumParse(const char *opt);
int blockMetaStatusEnumParse(const char *opt);