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

Consistent bash-completion if a command is not found #1272

Merged
merged 1 commit into from Jan 28, 2019
Merged

Consistent bash-completion if a command is not found #1272

merged 1 commit into from Jan 28, 2019

Conversation

antonstefanov
Copy link
Contributor

Hey,
it seems that if a command is not found, the fallback file autocompletion does not work the same as the standard bash autocompletion:

CURRENT
some-cmd folder-na(tab) -> some-cmd folder-name
currently the folder name is inserted, including a space at the end

PROPOSED
some-cmd folder-na(tab) -> some-cmd folder-name/
In the current bash versions the folder name is inserted with a slash at the end, allowing you to chain folder paths

With this change bash will decide how to handle the autocompletion.

tested on

MacOS 10.14

references

https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html
https://stackoverflow.com/a/22827323

Copy link
Contributor

@evocateur evocateur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, but I would also like to get feedback from the original contributor.

completion.sh.hbs Show resolved Hide resolved
Copy link
Member

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I like this change.

@bcoe bcoe merged commit da75ea2 into yargs:master Jan 28, 2019
@bcoe
Copy link
Member

bcoe commented Jan 28, 2019

@antonstefanov thank you for the contribution -- next we just need someone to finally implement Zsh completion 😛

@bcoe
Copy link
Member

bcoe commented Feb 2, 2019

@antonstefanov please try npm i yargs@next it should have your modifications to bash completions.

@antonstefanov
Copy link
Contributor Author

hey @bcoe nice, it works, I'm not using Zsh though (probably should), and can't help with the implementation

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

Successfully merging this pull request may close these issues.

None yet

4 participants