-
Notifications
You must be signed in to change notification settings - Fork 66
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
Bash completion script? #332
Comments
Take a look in the I'm interested to know how it goes. If it needs updates, I'll be glad to put them in. |
I found this file /dev/generate-completion-scripts.pl I'm not sure about how execute it. It tried the following (under $ wget https://github.com/beyondgrep/ack3/blob/dev/dev/generate-completion-scripts.pl
$ chmod u+x generate-completion-scripts.pl
$ ./generate-completion-scripts.pl
# Error message from max os
Can\'t locate Template.pm in @INC (you may need to install the Template module) (@INC contains: t blib/lib /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0 /usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level /usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0 /usr/local/lib/perl5/site_perl/5.32.0) at ./generate-completion-scripts.pl line 8.
BEGIN failed--compilation aborted at ./generate-completion-scripts.pl line 8.
# Try to install missing module
$ apt-get install libtemplate-perl
$ ./generate-completion-scripts.pl
# Error message from debian jessie (docker)
Can\'t locate Util.pm in @INC (you may need to install the Util module) (@INC contains: t blib/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at ./generate-completion-scripts.pl line 9.
BEGIN failed--compilation aborted at ./generate-completion-scripts.pl line 9.
# I don't kwow how to fix that! |
The first complaint is that it can't find Template.pm, which is the Template Toolkit module. You'll need to install that. You'll also need to clone the entire repo, not just that one script, because it uses the Util.pm module in the repo. Then run |
Definitively can't generate it : Using apt update
apt install -y git
git clone https://github.com/beyondgrep/ack3.git
cd ack3/
perl dev/generate-completion-scripts.pl completion.bash
# ERROR with Template module
# Install `cpan Template::Toolkit` or `cpan Template` didn't fix it
apt-get install -y libtemplate-perl
perl dev/generate-completion-scripts.pl completion.bash
# ERROR
# Can't locate File/Next.pm in @INC (you may need to install the File::Next module) (@INC contains: t blib/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at t/Util.pm line 12.
# BEGIN failed--compilation aborted at t/Util.pm line 12.
# Compilation failed in require at dev/generate-completion-scripts.pl line 9.
# BEGIN failed--compilation aborted at dev/generate-completion-scripts.pl line 9. |
If all you want is to be able to run it once and get the output, here you go.
|
which you'd install as (I get path completion out of the box so haven't played with this, but providing hints and completion on --options spellings could be useful!) Do we need to add this scripts pre-reqs to metadata as dev pre-reqs ? HOW TO should probably be a FAQ item. |
If somebody wants to take that on, go ahead. As far as I'm concerned, |
I tried the completion script and it works well. It's limited to the argument name but that's a good beginning. It worth to be added in source code and mentioned in install documentation $ ack -<tab>
--ackrc --env --ignore-directory --nogroup --type-add -f
--after-context --files-from --ignore-file --noheading --type-del -g
--bar --files-with-matches --invert-match --noignore-dir --type-set -h
--before-context --files-without-matches --literal --noignore-directory --version -i
--break --filter --man --nopager --with-filename -l
--cathy --flush --match --nosmart-case --word-regexp -m
--color --follow --max-count --output -1 -n
--color-filename --group --no-filename --pager -A -o
--color-lineno --heading --no-recurse --passthru -B -r
--color-match --help --nobreak --print0 -C -s
--colour --help-colors --nocolor --recurse -H -v
--column --help-rgb-colors --nocolour --show-types -L -w
--context --help-types --nocolumn --smart-case -Q -x
--count --ignore-ack-defaults --noenv --sort-files -R
--create-ackrc --ignore-case --nofilter --thpppt -S
--dump --ignore-dir --nofollow --type -c |
Hello,
I'm looking for a bash completion script. Does it exist?
The text was updated successfully, but these errors were encountered: