Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change semantics of ParseResult.rawOptionValue to mean after split (but before type conversion) #317

Closed
remkop opened this issue Mar 30, 2018 · 0 comments
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Mar 30, 2018

Needed for #258 for compatibility with commons-cli: the getOptionValue and getOptionValues methods in commons.cli .CommandLine return not the "raw" values as found on the command line, but the intermediate values after splitting the raw values into parts but before type conversion.

Mapping commons.cli.CommandLine methods to ParseResult methods

List<String>	getArgList() 	List<String>	unmatched()
String[]	getArgs() 		unmatched()
Object	getOptionObject(char opt)  [DEPRECATED]		
Object	getOptionObject(String opt)   [DEPRECATED]		
Properties	getOptionProperties(Option option) 		
Properties	getOptionProperties(String opt) 		
Option[]	getOptions() 	List<OptionSpec>	options()
String	getOptionValue(char opt) 	String	rawOptionValue(char shortName)
String	getOptionValue(char opt, String defaultValue) 	String	rawOptionValue(char shortName, java.lang.String defaultValue)
String	getOptionValue(Option option) 	String	rawOptionValue(CommandLine.Model.OptionSpec option)
String	getOptionValue(Option option, String defaultValue) 	String	rawOptionValue(CommandLine.Model.OptionSpec option, java.lang.String defaultValue)
String	getOptionValue(String opt) 	String	rawOptionValue(java.lang.String name)
String	getOptionValue(String opt, String defaultValue) 	String	rawOptionValue(java.lang.String name, java.lang.String defaultValue)
String[]	getOptionValues(char opt) 	List<String>	rawOptionValues(char shortName)
String[]	getOptionValues(Option option) 	List<String>	rawOptionValues(CommandLine.Model.OptionSpec option)
String[]	getOptionValues(String opt) 	List<String>	rawOptionValues(java.lang.String name)
Object	getParsedOptionValue(char opt) 	<T> T	optionValue(char shortName, T defaultValue)
Object	getParsedOptionValue(Option option) 	<T> T	optionValue(CommandLine.Model.OptionSpec option, T defaultValue)
Object	getParsedOptionValue(String opt) 	<T> T	optionValue(java.lang.String name, T defaultValue)
boolean	hasOption(char opt) 	boolean	hasOption(char shortName)
boolean	hasOption(Option opt) 	boolean	hasOption(CommandLine.Model.OptionSpec option)
boolean	hasOption(String opt) 	boolean	hasOption(java.lang.String name)
Iterator<Option>	iterator() 	List<OptionSpec>	options()
			
			
-	-	boolean	hasPositional(CommandLine.Model.PositionalParamSpec positional)
-	-	boolean	hasPositional(int position)
-	-	boolean	hasSubcommand()
-	-	boolean	isUsageHelpRequested()
-	-	boolean	isVersionHelpRequested()
-	-	CommandLine.Model.OptionSpec	option(char shortName)
-	-	CommandLine.Model.OptionSpec	option(java.lang.String name)
-	-	java.util.List<java.lang.String>	originalArgs()
-	-	CommandLine.Model.PositionalParamSpec	positional(int position)
-	-	java.util.List<CommandLine.Model.PositionalParamSpec>	positionalParams()
-	-	<T> T	positionalValue(CommandLine.Model.PositionalParamSpec positional, T defaultValue)
-	-	<T> T	positionalValue(int position, T defaultValue)
-	-	java.lang.String	rawPositionalValue(int position)
-	-	java.lang.String	rawPositionalValue(int position, java.lang.String defaultValue)
-	-	CommandLine.ParseResult	subcommand()
@remkop remkop added this to the 3.0 milestone Mar 30, 2018
@remkop remkop added status: invalid 😶 An issue that we don't feel is valid status: declined ❌ A suggestion or change that we don't feel we should currently apply labels Mar 30, 2018
@remkop remkop closed this as completed Mar 30, 2018
@remkop remkop removed status: invalid 😶 An issue that we don't feel is valid status: declined ❌ A suggestion or change that we don't feel we should currently apply labels Mar 31, 2018
@remkop remkop changed the title Add optionStrings methods to ParseResult Change semantics of ParseResult.rawOptionValue to mean after split (but before type conversion) Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant