CMDOption - Macro206/CMDKit-Framework GitHub Wiki
CMDOption holds information about an option. It can then be used in conjunction with CMDArgumentHandle to mark it as a valid option and to retrieve its arguments.
int numberOfArguments
The number of arguments that should follow the option. Used by CMDArgumentHandle to retrieve the arguments.
BOOL isWordOption
Whether the option is a word or just a single letter. Denotes whether the option should be preceded by two dashes (if YES
) or just one (if NO
).
NSString *name
The "name" of the option.
Note: It does not include the dash/dashes.
For example: If the option should appear as an argument as -v
, then the name should be @"v"
.
If the option should appear as an argument as --name
, then the name should be @"name"
.
+(id)optionWithNumberOfArguments:(int)n isWord:(BOOL)isWord name:(NSString *)aName
Creates an option with the given number of arguments, name, and whether it is a word or just a single letter.
- (NSString *)fullString
Returns the whole string that represents the option, including the dash/dashes, just how it would appear as one of the program's arguments.