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

Export usages as docopt #313

Open
fenollp opened this issue Mar 20, 2023 · 1 comment
Open

Export usages as docopt #313

fenollp opened this issue Mar 20, 2023 · 1 comment

Comments

@fenollp
Copy link

fenollp commented Mar 20, 2023

(Opening this to track but I'll probably end up implementing this myself.)

I love explainshell and I love docopt.org. I wish there was a docopt repo of many common commands so docopt adoption and usage would grow faster.
This repo does the dirty work of making sense of many/various manpages so they can be indexed and matched against an actual call.

I suggest to store these parsed manpages as docopt usage strings and to use docopt machinery to match the call.

  • Matching comes for free
  • This can help grow docopt.org's documentation
  • Programs that use docopt can be added to the index instantly

If matching needs optimizing, one could also just provide an API that, given a command or a call, gives back a docopt usage string for that command.

@idank
Copy link
Owner

idank commented Mar 20, 2023

I'd be scared of tying a generic tool like explainshell to the format of a particular tool. I also wouldn't be surprised if some evil command arguments weren't expressible in docopt.

I do think explainshell needs an internal for its index though, I'm just not sure this is the right one.

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

2 participants