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

Can it support customize arguments info? #10

Closed
elvismacak opened this issue Mar 6, 2017 · 1 comment
Closed

Can it support customize arguments info? #10

elvismacak opened this issue Mar 6, 2017 · 1 comment
Labels

Comments

@elvismacak
Copy link

Like can I customize the argument type, description or something else?

I would like to export it as a json schema file , and build it as a gui tool with the export schema file.

Thx

@dbieber
Copy link
Member

dbieber commented Mar 9, 2017

  • You can specify the description by adding docstrings to your code. e.g. if you are calling Fire on a function, the function's docstring will be used in the help message of the resulting CLI.
  • By default, the argument type is inferred from the argument itself, not from the function being called. There is an experimental feature that lets you change the way arguments are parsed (see decorators.py), but it's just experimental.
  • Exporting a description of the CLI as json and using that for other projects, like making GUI tools, is an interesting idea. It's definitely doable, but is non-trivial, and also not a priority. If you're interested in pursuing this route, I recommend looking at how completion scripts are generated in completion.py. You may be able to do something similar to export the information that you're interested in.

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

No branches or pull requests

2 participants