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

Use docopt for multirust binary #38

Closed
jwilm opened this issue Dec 16, 2015 · 5 comments
Closed

Use docopt for multirust binary #38

jwilm opened this issue Dec 16, 2015 · 5 comments

Comments

@jwilm
Copy link
Contributor

jwilm commented Dec 16, 2015

Hey @Diggsey,

I've been poking around this project a bit to figure out the library API, and I had a look at the cli file. It's sort of..... unapproachable 😁. The API multirust exposes could easily be written using docopt, and it would make maintenance a lot easier.

Are you open to a PR for this if it showed up?

@Diggsey
Copy link
Contributor

Diggsey commented Jan 3, 2016

Hi @jwilm, I'm a little skeptical of tools which generate the CLI from the usage text, as I usually find it too restrictive. I'm not prepared to switch to docopt purely on the basis of neatness/maintenance, as I personally find cli.rs to be quite structured and easy to modify. It is long, but that's mainly due to the amount of descriptive text about each command.

However, I may be open to switching if the alternative provides other tangible benefits (such as being able to handle OsStrings correctly) without having signficant drawbacks.

@azerupi
Copy link

azerupi commented Jan 4, 2016

Clap-rs is another contender that is worth looking into.

@Diggsey
Copy link
Contributor

Diggsey commented Jan 4, 2016

@azerupi clap-rs is what multirust currently uses.

@azerupi
Copy link

azerupi commented Jan 4, 2016

Ah sorry, my mistake. I should have looked before saying anything.
When @jwilm said "unapproachable" I assumed something else was used because I find Clap-rs one of the best structured and easy ways to create a CLI. :)

After taking a look at cli.rs I don't find it "unapproachable". If you have used clap-rs a little it is not hard to understand. It is true that the "help" strings are very long, maybe moving them into constants above or below would make the CLI code more clear?

@jwilm
Copy link
Contributor Author

jwilm commented Jan 11, 2016

Hey @Diggsey and @azerupi,

Thanks for the discussion about this. You're right that docopt would be too restrictive for multirust-rs; it doesn't appear to support extended help for subcommands. I'm on a bit of a docopt kick lately since it has made my CLI source files stupid simple. I should have looked more closely at what the multirust-rs cli.rs was actually doing first. Sorry about that! At least there's an issue in the history now for the next person who might be curious about cli.rs/docopt 😄.

@azerupi you're totally right that the clap-rs API is straight-forward. I would argue that having no API is simpler, though. It will definitely be my go-to arg parser if/when I run into the limits of docopt.

clap-rs seems to be a good choice here; closing.

@jwilm jwilm closed this as completed Jan 11, 2016
djc added a commit that referenced this issue Jun 18, 2024
# This is the 1st commit message:

Port cli_inst_interactive to CliTestContext

# The commit message #2 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #3 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #4 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #5 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #6 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #7 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #8 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #9 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #10 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #11 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #12 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #13 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #14 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #15 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #16 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #17 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #18 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #19 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #20 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #21 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #22 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #23 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #24 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #25 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #26 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #27 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #28 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #29 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #30 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #31 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #32 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #33 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #34 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #35 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #36 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #37 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #38 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #39 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext

# The commit message #40 will be skipped:

# fixup! Port cli_inst_interactive to CliTestContext
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

3 participants