-
-
Notifications
You must be signed in to change notification settings - Fork 151
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 shell autocomplete #228
Conversation
I see travis is failing because this drops below 100% coverage. I don't really have the time/desire to write tests for this at the moment, but I might at some point. I created the PR with the ability to add edits from maintainers if anyone would like to add them. |
@theacodes are you okay with the addition of a new dependency, argcomplete? Some good things about it
Downside
Other options
|
I'm happy taking it on if it has no other dependencies and is relatively
stable.
…On Sat, Aug 10, 2019 at 4:34 PM Chad Smith ***@***.***> wrote:
@theacodes <https://github.com/theacodes> are you okay with the addition
of a new dependency, argcomplete <https://github.com/kislyuk/argcomplete>?
Some good things about it
- It has no dependencies of its own
- It's actively maintained
- It works for multiple shells
- It's dynamically generated base on nox's arguments. This means the
nox maintainers don't have to continuously update and test custom shell
completion scripts.
Downside
- Additional dependency
Other options
- Add an extra such as nox[completions] to nox's setup.py so it's not
included in the base nox package. This requires a little extra
overhead for those that want shell completions, but avoids forcing that
requirement on *all* nox installations.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#228>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB5I43GBH2EC7AFV575VVLQD5F7DANCNFSM4IJGPZTQ>
.
|
Great! We should be good, and also have the extra safety of limiting the versions nox requires (>=1.9.4, <2.). I will work on getting this test passing now. |
Tests have been added and CI is now passing. |
This is rad, thank you @cs01! |
To try this out in bash run the following. Other shells also have limited support. See instructions in the docs in this PR.
A sample of the autocompletions for all items that start with a
--
:The
_session_completer
function provides a list of sessions when hitting tab innox -s <tab>
. argcomplete providesparsed_args
to this function, which is the Namespace argparse would have returned if the program were actually run. This corresponds almost directly to nox's global_config, and it works out of the box 😄 .Note that this adds a new dependency to nox in setup.py,
argcomplete
.fixes #227
cc @theacodes