* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
private List<Cmd> cmds;
public Help(AAFcli aafcli, List<Cmd> cmds) {
- super(aafcli, "--help",
+ super(aafcli, "help",
new Param("-d (more details)", false),
new Param("command",false));
this.cmds = cmds;
}
@Override
- public int _exec( int _idx, final String ... args) throws CadiException, APIException, LocatorException {
- int idx = _idx;
+ public int _exec( int idxValue, final String ... args) throws CadiException, APIException, LocatorException {
+ int idx = idxValue;
boolean first = true;
StringBuilder sb = new StringBuilder("AAF Command Line Tool");
StringBuilder details;
details = aafcli.isDetailed()?new StringBuilder():null;
String comp = args.length>idx?args[idx++]:null;
- if("help".equalsIgnoreCase(comp)) {
+ if ("help".equalsIgnoreCase(comp)) {
build(sb,null);
detailedHelp(4, sb);
sb.append('\n');
} else {
- for(Cmd c : cmds) {
- if(!(c instanceof DeprecatedCMD)) {
- if(comp!=null) {
- if(comp.equals(c.getName())) {
+ for (Cmd c : cmds) {
+ if (!(c instanceof DeprecatedCMD)) {
+ if (comp!=null) {
+ if (comp.equals(c.getName())) {
multiChar(sb,2,' ',0);
c.build(sb,details);
}
} else {
- if(first) {
+ if (first) {
first=false;
} else {
multiChar(sb,80,'-',2);
}
multiChar(sb,2,' ',0);
c.build(sb,details);
- if(details!=null) {
+ if (details!=null) {
c.detailedHelp(4, sb);
- // multiChar(sb,80,'-',2);
}
}
}
pw().println(sb.toString());
return 200 /*HttpStatus.OK_200*/;
}
-
+
@Override
- public void detailedHelp(int _indent, StringBuilder sb) {
- int indent = _indent;
+ public void detailedHelp(int indentValue, StringBuilder sb) {
+ int indent = indentValue;
detailLine(sb,indent,"To print main help, enter \"aafcli\" or \"aafcli --help \"");
detailLine(sb,indent,"To print narrow the help content, enter sub-entries after aafcli,");
detailLine(sb,indent+2,"i.e. \"aafcli perm\"");