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

Compulsory Arguments returning wrong value #17

Open
rajula96reddy opened this issue Jul 11, 2017 · 3 comments
Open

Compulsory Arguments returning wrong value #17

rajula96reddy opened this issue Jul 11, 2017 · 3 comments

Comments

@rajula96reddy
Copy link

Hi,
When I don`t use compulsory args and try this

| pos1 command context match|
	pos1 := (ClapPositional withName: 'inputFile').
	command := (ClapCommand withName: 'MyApp')
		addPositional: pos1. 
 context := ClapContext on: #('MyApp' 'input.txt').
	match := command matchOn: context.
	(match at:pos1) value. "Returns input.txt"

But when I use compulsory args and try 
| pos1 command context match|
	pos1 := (ClapPositional withName: 'inputFile').
	command := (ClapCommand withName: 'MyApp')
		addCompulsory: (pos1) asCompulsory .
 context := ClapContext on: #('MyApp' 'input.txt').
	match := command matchOn: context.
	(match at:pos1) value. "Returns inputFile"

Shouldn`t they both return the same value. The second one is returning the positional name rather than the value. Am I doing it correct?

@cdlm
Copy link
Collaborator

cdlm commented Jul 11, 2017

Compulsory support does not exist yet. I'm guessing you've loaded code from one of @ClementMastin's branches?

Clap is still under heavy (re)design…

@rajula96reddy
Copy link
Author

rajula96reddy commented Jul 11, 2017

Yeah, I know. And I loaded the code from the "compulsory arguments" branch of Clement`s repo. I was writing examples for the clap (as guided by Guille) so I thought I will report this bug. Nothing more.

@cdlm
Copy link
Collaborator

cdlm commented Jul 2, 2018

This is a form of validation, see #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants