public class DefaultNCmdLine extends Object implements NCmdLine
NCmdLine args=new DefaultNCmdLine(Arrays.asList("--!deleteLog","--deploy","/deploy/path","--deploy=/other-deploy/path","some-param"));
Argument a;
while (args.hasNext()) {
if ((a = args.nextBoolean("--deleteLog").orNull()) != null) {
deleteLog = a.getBooleanValue().get(session);
} else if ((a = args.nextString("--deploy").orNull()) != null) {
apps.add(a.getStringValue().get(session));
} else if ((a = args.next()) != null) {
name = a.getString();
} else {
args.throwUnexpectedArgument();
}
}
| Modifier and Type | Field and Description |
|---|---|
protected LinkedList<String> |
args |
protected String |
commandName |
protected boolean |
expandArgumentsFile |
protected boolean |
expandSimpleOptions |
protected List<NArg> |
lookahead |
protected Set<String> |
specialSimpleOptions |
| Constructor and Description |
|---|
DefaultNCmdLine()
Default n cmd line.
|
DefaultNCmdLine(List<String> args)
Default n cmd line.
|
DefaultNCmdLine(String[] args,
NShellFamily shellFamily)
Default n cmd line.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, of, of, of, of, ofArgs, ofArgs, ofDefault, parse, parse, parse, parseDefaultspliteratorfirstNonBlank, firstNonBlank, firstNonBlank, firstNonBlankLazy, firstNonBlankLazy, isBlank, isBlank, isBlank, isBlank, isBlank, isNonBlankprotected LinkedList<String> args
protected boolean expandSimpleOptions
protected boolean expandArgumentsFile
protected String commandName
public DefaultNCmdLine()
public DefaultNCmdLine(String[] args, NShellFamily shellFamily)
args - argsshellFamily - shell familypublic NShellFamily shellFamily()
shellFamily in interface NCmdLinepublic NCmdLine shellFamily(NShellFamily shellFamily)
shellFamily in interface NCmdLineshellFamily - shell familypublic NCmdLineConfigurable configurable()
configurable in interface NCmdLinepublic NCmdLine configurable(NCmdLineConfigurable configurable)
configurable in interface NCmdLineconfigurable - configurablepublic boolean isExpandArgumentsFile()
isExpandArgumentsFile in interface NCmdLinepublic NCmdLine expandArgumentsFile(boolean expandArgumentsFile)
expandArgumentsFile in interface NCmdLinepublic NArgCompleteResult completeResult()
completeResult in interface NCmdLinepublic NArgCompleteResult printCompleteResult()
printCompleteResult in interface NCmdLinepublic NCmdLine completePosition(NArgCompletePosition completePosition)
completePosition in interface NCmdLinepublic NCmdLine unregisterSpecialSimpleOption(String option)
unregisterSpecialSimpleOption in interface NCmdLinepublic String[] specialSimpleOptions()
specialSimpleOptions in interface NCmdLinepublic NCmdLine registerSpecialSimpleOption(String option)
registerSpecialSimpleOption in interface NCmdLinepublic boolean isSpecialSimpleOption(String option)
isSpecialSimpleOption in interface NCmdLinepublic boolean isExecMode()
isExecMode in interface NCmdLinepublic boolean isCompleteMode()
isCompleteMode in interface NCmdLinepublic String commandName()
commandName in interface NCmdLinepublic NCmdLine commandName(String commandName)
commandName in interface NCmdLinepublic boolean isExpandSimpleOptions()
isExpandSimpleOptions in interface NCmdLinepublic NCmdLine expandSimpleOptions(boolean expand)
expandSimpleOptions in interface NCmdLinepublic NCmdLine throwUnexpectedArgument(NText errorMessage)
throwUnexpectedArgument in interface NCmdLinepublic NCmdLine throwUnexpectedArgument(NMsg errorMessage)
throwUnexpectedArgument in interface NCmdLinepublic NCmdLine throwMissingArgument()
throwMissingArgument in interface NCmdLinepublic NCmdLine throwMissingArgument(String argumentName)
throwMissingArgument in interface NCmdLinepublic NCmdLine throwMissingArgument(NMsg errorMessage)
throwMissingArgument in interface NCmdLinepublic NCmdLine throwUnexpectedArgument()
throwUnexpectedArgument in interface NCmdLinepublic boolean isNextOption()
isNextOption in interface NCmdLinepublic boolean isNextNonOption()
isNextNonOption in interface NCmdLinepublic NOptional<NArg> peekNonOption()
peekNonOption in interface NCmdLinepublic NOptional<NArg> peekOption()
peekOption in interface NCmdLinepublic boolean hasNextOption()
hasNextOption in interface NCmdLinepublic boolean hasNextNonOption()
hasNextNonOption in interface NCmdLinepublic NOptional<NArg> nextAttachedEntry(String... names)
nextAttachedEntry in interface NCmdLinepublic NOptional<NArg> nextRequiredEntry(String... names)
nextRequiredEntry in interface NCmdLinepublic NOptional<NArg> nextAttachedEntry()
nextAttachedEntry in interface NCmdLinepublic NOptional<NArg> nextRequiredEntry()
nextRequiredEntry in interface NCmdLinepublic NCmdLineMatcher matcher()
public NArgCompletePosition completePosition()
completePosition in interface NCmdLinepublic NOptional<NArg> next(NArgType expectedArgType, String argDisplay, NArgValueComplete valueComplete, String... names)
public NOptional<NArg> nextNonOption(String display)
nextNonOption in interface NCmdLinepublic NOptional<NArg> nextNonOption(String display, NArgValueComplete complete)
nextNonOption in interface NCmdLinepublic NOptional<NArg> nextNonOption()
nextNonOption in interface NCmdLinepublic boolean accept(int index,
String... values)
public String[] toStringArray()
toStringArray in interface NCmdLinepublic String[] nextAllAsStringArray()
nextAllAsStringArray in interface NCmdLinepublic List<String> nextAllAsStringList()
nextAllAsStringList in interface NCmdLinepublic NArg[] nextAllAsArgumentArray()
nextAllAsArgumentArray in interface NCmdLinepublic List<String> toStringList()
toStringList in interface NCmdLinepublic NArg[] toArgumentArray()
toArgumentArray in interface NCmdLinepublic boolean isNonOption(int index)
isNonOption in interface NCmdLinepublic NCmdLine setArguments(List<String> arguments)
setArguments in interface NCmdLinearguments - argumentspublic NCmdLine setArguments(String[] arguments)
setArguments in interface NCmdLinearguments - argumentspublic void throwError(NMsg message)
throwError in interface NCmdLinepublic void throwError(NText message)
throwError in interface NCmdLinepublic NOptional<NArg> next(boolean expandSimpleOptions, boolean expandArgumentsFile)
expandSimpleOptions - expand simple optionsexpandArgumentsFile - expand arguments filepublic static NOptional<String[]> parseDefaultList(String commandLineString)
commandLineString - command line stringpublic boolean isBlank()
isBlank in interface NBlankableCopyright © 2026 vpc open source initiative. All rights reserved.