auto completion with tab: separate commands and tree structure
J Rt
jean.rblt at gmail.com
Sat Mar 28 14:45:06 CET 2020
Thanks for your help, got it to work now. All was needed is change the
last line of the autocomplete script to:
complete -o nosort -o filenames -F _pass pass
the nosort option cancels the sorting done in the background by bash.
Found it there, should be ok with bash 4.4 and higher:
https://unix.stackexchange.com/questions/215937/disable-sorting-of-compreply-in-bash-complete-function
now when hitting tab tab I get first the (1){pass commands or
options}, then the (2){folders / files}.
The sets (1) and (2) are not sorted though, but I think I will get it
done easily.
On Sat, Mar 28, 2020 at 8:50 AM Reed Wade <reedwade at misterbanal.net> wrote:
>
> > Ok, sounds good. Do you agree that this would be a bit nicer tab
> > autocompletion? Or do you mind a lot having to type 'show' to get the
> > second autocompletion? :) .
>
> I just always type 'show' so it only giving me the tree.
>
> > Do you think you would be able to implement the change you described
> > in your last message?
>
> I don't think anyone want to remove the command shortcut show sorry :D
>
> > If not I can give it a look / try, but I do not
> > have too much experience with this sort of scripting.
>
> I think the better thing to do in this case, is downloading the
> pass script and the autocompletion script, putting them in your ~/bin
> and .local/share/bash-completion/completions/ pathes and customize them.
>
> Removing the shortcut probably is easy, adapting the autocompletion
> script will need a little more understanding.
>
> A little tuto I use myself is :
> https://opensource.com/article/18/3/creating-bash-completion-script
More information about the Password-Store
mailing list