attr.getValues().add(OnapCliConstants.PARAM_INTERACTIVE_HELP);
attrDesc.getValues().add(OnapCliConstants.PARAM_INTERACTIVE_HELP_MSG);
+ attr.getValues().add(OnapCliConstants.PARAM_INTERACTIVE_PROFILE);
+ attrDesc.getValues().add(OnapCliConstants.PARAM_INTERACTIVE_PROFILE_MSG);
try {
return "\n\nDirectives:\n" + help.print();
} catch (OnapCommandException e) {
} else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_VERSION)) {
this.args = Arrays.asList(new String [] {this.getLongOption(OnapCliConstants.PARAM_VERSION_LONG)});
handleVersion();
+ } else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_PROFILE)) {
+ if (args.size() == 1) {
+ this.print("Please use it in the form of 'profile <profile-name>'");
+ } else {
+ this.args = Arrays.asList(new String [] {
+ this.getLongOption(OnapCliConstants.PARAM_PROFILE_LONG),
+ this.args.get(1)});
+ handleProfile();
+ }
} else if (!args.isEmpty() && this.args.get(0).equals(OnapCliConstants.PARAM_INTERACTIVE_SET)) {
if (args.size() > 1) {
String [] paramEntry = args.get(1).trim().split("=");
OnapCliConstants.PARAM_INTERACTIVE_HELP,
OnapCliConstants.PARAM_INTERACTIVE_VERSION,
OnapCliConstants.PARAM_INTERACTIVE_SET,
- OnapCliConstants.PARAM_INTERACTIVE_UNSET);
+ OnapCliConstants.PARAM_INTERACTIVE_UNSET,
+ OnapCliConstants.PARAM_INTERACTIVE_PROFILE);
console.addCompleter(strCompleter);
console.setPrompt(OnapCliConstants.PARAM_INTERACTIVE_PROMPT);
} catch (OnapCommandException e) { // NOSONAR
public static final String PARAM_INTERACTIVE_SET_MSG = "To set the parameter values. Once its set, will be available for all commands in current session.";
public static final String PARAM_INTERACTIVE_UNSET = "unset";
public static final String PARAM_INTERACTIVE_UNSET_MSG = "To unset the parameter value in current session.";
+ public static final String PARAM_INTERACTIVE_PROFILE = "profile";
+ public static final String PARAM_INTERACTIVE_PROFILE_MSG = "Start profiling current settings made of use, set.";
+
public static final String PARAM_INTERACTIVE_ARG_SPLIT_PATTERN = "\\s+";
private OnapCliConstants(){}