Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

handling arg flags with options followed by non-options #77

Open
maphew opened this issue Nov 18, 2012 · 1 comment
Open

handling arg flags with options followed by non-options #77

maphew opened this issue Nov 18, 2012 · 1 comment

Comments

@maphew
Copy link

maphew commented Nov 18, 2012

Can clint handle arguments with options (flags) followed by something else not related to the option? If so, how?

Many existing programs operating in the environment where I'm creating my program in use the patterns below, all of which are functionally identical.

bazwarp --target-size 1024 768 --resample=cubic input.jpg output.jpg
bazwarp --resample cubic input.jpg output.jpg --target-size 1024 768 
bazwarp -r cubic input.jpg -ts 1024 768 output.jpg
bazwarp input.jpg output.jpg --target-size 1024 768 --resample cubic 

Following clint\example\args.py, it looks like only the last of these would be grouped by correctly* by clint, right? (Where "correctly" means I would only have to have to write one code block to handle each parameter or group, and those blocks would handle all four variants (thought admittedly sprinkling the in/out files among the flags in the 3rd example a bit contrived)).

@mattupstate
Copy link

+1 !

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

No branches or pull requests

2 participants