balloon-lang icon indicating copy to clipboard operation
balloon-lang copied to clipboard

Use a command line library crate

Open polybuildr opened this issue 8 years ago • 9 comments

The current handling of command line arguments (refer to fn main in main.rs) is rather crude. Using a command line library crate would definitely make things simpler.

polybuildr avatar Jun 08 '17 22:06 polybuildr

There seem to be some good crates available for this: https://crates.io/keywords/cli?sort=downloads

polybuildr avatar Jun 10 '17 15:06 polybuildr

Hmm, bad search. The top 3 here - https://crates.io/keywords/command?sort=downloads - are probably what we should look at. clap, docopt and argparse.

polybuildr avatar Jun 10 '17 15:06 polybuildr

@pbteja1998 has expressed interest in taking this up. :)

polybuildr avatar Jun 10 '17 15:06 polybuildr

@polybuildr, I will not be able to work on this. I got some other work.

pbteja1998 avatar Jun 11 '17 13:06 pbteja1998

I'm working on this

ghost avatar Jun 23 '17 22:06 ghost

@anukul that's great! I suggest you compare the solutions I listed above: clap and docopt, most importantly. They're the most used command line argument crates and have two different approaches. Feel free to compare both here, and then we can move forward with one of them.

polybuildr avatar Jun 24 '17 08:06 polybuildr

@polybuildr clap seems more flexible to me as it allows specifying arguments manually as well as deriving them from usage strings, while docopt only supports usage strings. also, clap's auto-generated tab completion is better as it always results in valid matches, docopt's does not.

ghost avatar Jun 26 '17 20:06 ghost

Sounds good. In that case, let's go for Clap.

polybuildr avatar Jun 27 '17 08:06 polybuildr

@anukul, any updates?

polybuildr avatar Jul 11 '17 20:07 polybuildr