From cfaa1038ae490697a248249715c75043841bd951 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Tue, 27 Mar 2018 11:40:22 +0530 Subject: Add state info in help message Issue-ID: CLI-78 Change-Id: Ie79342fc3fc5322ca9b1a6517b03c8d7bf03dd81 Signed-off-by: Kanagaraj Manickam k00365106 --- .../java/org/onap/cli/fw/registrar/OnapCommandRegistrar.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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); } -- cgit 1.2.3-korg