-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add links to the query api page in view and find --help #761
Conversation
signac/__main__.py
Outdated
@@ -1469,8 +1469,10 @@ def main(): | |||
parser_find = subparsers.add_parser( | |||
"find", | |||
description="""All filter arguments may be provided either directly in JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be helpful to use some intentional line breaks in this message. I looked at man
pages for a few executables and commands like apt search --help
, docker run --help
and including line breaks is very common for longer descriptions like this. I'd recommend the following:
Filter arguments may be provided directly as JSON or in a simplified form using the query API. For, example the following two bash commands are equivalent:
$ signac find key 42
$ signac find '{"a": 42}'
For more information, see: https://docs.signac.io/en/latest/query.html#simplified-filter
Note that we have an anchor in the source that can be used to shorten this URL: https://github.com/glotzerlab/signac-docs/blame/ddd4a06b23f82b722303d31b3d1eb7338a2fcd97/docs/source/query.rst#L251
I'd do something similar for the other case, too. This is helpful, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. The included argparse.RawDescriptionHelpFormatter
and argparse.RawTextHelpFormatter
don't allow wrapping of some text while preserving blank lines. There is a long running feature request for a better formatter for argparse.
I propose adding a new dependency argparse-formatter and its FlexiFormatter
, which has been proposed for inclusion in Python, until it gets merged.
See the source of the formatter for docs.
for more information, see https://pre-commit.ci
@cbkerr For some context: you may have observed from making this PR that |
Description
Adds plaintext links to the output of
signac view --help
andsignac find --help
Motivation and Context
I and others often can't find the query api page from the docs about finding and viewing.
Tested by building locally.
Checklist: