--no-boolean

34 views
Skip to first unread message

Alexis Lee

unread,
Aug 2, 2013, 4:18:58 AM8/2/13
to jewe...@googlegroups.com
Hiya, first of all thank you for providing an arg-parsing library with such a readable interface.

Here's my Option:
@Option( description = "Whether allPosts should be set", defaultValue = "true" )
boolean getAllPosts();

Given this, I'd like --all-posts to set the option (IE do nothing as default is true) while --no-all-posts sets it false. I'd imagine this could be made available to all options of type boolean/Boolean automatically.

I could easily rename the option getNoAllPosts and will do so for now, but I prefer positive logic when possible. I now have the slightly dizzying:

dto.setAllPosts( !opts.getNoAllPosts() );

Tim Wood

unread,
Aug 4, 2013, 12:37:25 PM8/4/13
to jewe...@googlegroups.com
Hi,

I can understand why this would be useful, but I don't think there is a straight-forward way to add it given the current implementation. I am in the process of adding a way to plug in a custom parser, but I don't have a lot of time to work on it right now.

Cheers,

Tim





--
You received this message because you are subscribed to the Google Groups "jewelcli" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jewelcli+u...@googlegroups.com.
To post to this group, send email to jewe...@googlegroups.com.
Visit this group at http://groups.google.com/group/jewelcli.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexis Lee

unread,
Aug 5, 2013, 4:22:55 AM8/5/13
to jewe...@googlegroups.com
Fair enough, thanks for responding.
Reply all
Reply to author
Forward
0 new messages