summaryrefslogtreecommitdiffstats
path: root/framework/src
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-27 11:40:22 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-27 11:40:22 +0530
commitcfaa1038ae490697a248249715c75043841bd951 (patch)
tree991f5c73139b301c2cf30253a1b80d495a1cdbb1 /framework/src
parentf5609349ba12f9bcdccc202c57a9438f22996c26 (diff)
Add state info in help message
Issue-ID: CLI-78 Change-Id: Ie79342fc3fc5322ca9b1a6517b03c8d7bf03dd81 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java b/framework/src/main/java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java
index bd7977b3..34dc6b6d 100644
--- a/framework/src/main/java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java
+++ b/framework/src/main/java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java
@@ -366,13 +366,22 @@ public class OnapCommandRegistrar {
attrSrv.setScope(OnapCommandResultAttributeScope.SHORT);
help.getRecords().add(attrSrv);
+ OnapCommandResultAttribute attrState = new OnapCommandResultAttribute();
+ attrState.setName(OnapCommandConstants.INFO_STATE.toUpperCase());
+ attrState.setDescription(OnapCommandConstants.INFO_STATE);
+ attrState.setScope(OnapCommandResultAttributeScope.SHORT);
+ help.getRecords().add(attrState);
+
+
OnapCommandResultAttribute attrDesc = new OnapCommandResultAttribute();
attrDesc.setName(OnapCommandConstants.DESCRIPTION.toUpperCase());
attrDesc.setDescription(OnapCommandConstants.DESCRIPTION);
attrDesc.setScope(OnapCommandResultAttributeScope.SHORT);
help.getRecords().add(attrDesc);
- for (String cmdName : isEnabledProductVersionOnly ? OnapCommandUtils.sort(this.listCommandsForEnabledProductVersion()) : OnapCommandUtils.sort(this.listCommands())) {
+ for (String cmdName : isEnabledProductVersionOnly ?
+ OnapCommandUtils.sort(this.listCommandsForEnabledProductVersion()) :
+ OnapCommandUtils.sort(this.listCommands())) {
OnapCommand cmd;
try {
if (!isEnabledProductVersionOnly) {
@@ -387,6 +396,7 @@ public class OnapCommandRegistrar {
attrSrv.getValues().add(cmd.getInfo().getService());
attrDesc.getValues().add(cmd.getDescription());
+ attrState.getValues().add(cmd.getInfo().getState().name());
} catch (OnapCommandException e) {
throw new OnapCommandHelpFailed(e);
}