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

Improve bash completion #215

Open
wants to merge 3 commits into
base: master
from
Open

Conversation

@gportay
Copy link
Contributor

@gportay gportay commented Jun 18, 2019

This PR improves the support for bash completion of casync.

It supports for options and handles per-command completion.

This commit adds the completion support for almost all current options.
The options that required a number or not supported (ie. --chunk-size,
--rate-limit-bps, --uid-shift and --uid-range).
@gportay gportay force-pushed the gportay:shell-completion branch from 39d343c to c786ac6 Jun 20, 2019
@gportay
Copy link
Contributor Author

@gportay gportay commented Jun 20, 2019

I fixed a bug in the second commit for command completion if an option with an argument is entered before the command verb.

For example casync --log-level debug make

@gportay gportay force-pushed the gportay:shell-completion branch from c786ac6 to fe6c128 Jul 4, 2019
gportay added 2 commits Jun 14, 2019
This commit adds support for argument completion of every commands as
defined in the man page.
Introduce helper function __casync_get_arg_n to return the n-th argument
in $arg. The function takes into consideration the options whose the
following argument should not be counted as argument, and the options
that should be counted as argument.

It replaces the helper function in_array to get the command from the
already entered command line.

This function is a modified version of the helper function _count_args
from the bash-completion project.
@gportay gportay force-pushed the gportay:shell-completion branch from fe6c128 to 58a430d Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.