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

Don't be too strict with positional and positionalList names #68

Open
holgerbrandl opened this issue Sep 20, 2018 · 0 comments
Open

Don't be too strict with positional and positionalList names #68

holgerbrandl opened this issue Sep 20, 2018 · 0 comments

Comments

@holgerbrandl
Copy link

I'd expect the following bits to be legit but for some reason they are not:

class MyArgs(parser: ArgParser) {

    val imageDirectory by parser.positional("directory", "The directory which should be scanned for orphan images")

    val markdownFiles by parser.positionalList("<md files>", "Markdown files to be used as reference to detect orphans")
}
Exception in thread "main" java.lang.IllegalArgumentException: directory is not a valid argument name
	at com.xenomachina.argparser.PositionalDelegate.<init>(PositionalDelegate.kt:33)
	at com.xenomachina.argparser.ArgParser.positionalList(ArgParser.kt:315)
	at com.xenomachina.argparser.ArgParser.positional(ArgParser.kt:263)
	at com.xenomachina.argparser.ArgParser.positional(ArgParser.kt:246)
	at MyArgs.<init>(orphimg.kt:15)
	at OrphimgKt$main$args$1$1.invoke(orphimg.kt:20)
	at OrphimgKt$main$args$1$1.invoke(orphimg.kt)
	at com.xenomachina.argparser.ArgParser.parseInto(ArgParser.kt:469)

For some reason the PositionalDelegate is overly strict (just captialized letters) when it comes to naming my parameter.

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

1 participant