Fish-shell: completion for path should trigger for relative paths

Created on 22 Jul 2019  路  1Comment  路  Source: fish-shell/fish-shell

fish version: 3.0.2
Terminal: xterm-256color
Ubuntu 19

Hi,
I currently try to get more familiar with fish completions. My goal to achieve:
I have a bash script /home/auser/myscript that can take arguments and options like ./myscript dosomething -s or ./myscript dosomethingelse

I would like to create fish autocompletions for that script.

I assumed that complete -p /home/auser/myscript -f -a 'dosomething dosomethingelse' -d "Some comment" should do this but I do not get autocomplete options when typing ./myscript <TAB> or /home/auser/myscript <TAB>.

Do I missunderstand something here?

Thanks in advance for your help.

enhancement

Most helpful comment

I assumed that complete -p /home/auser/myscript -f -a 'dosomething dosomethingelse' -d "Some comment" should do this but I do not get autocomplete options when typing ./myscript or /home/auser/myscript .

This works for me with the full path (or via $PATH, if it's in), but not the relative ./.

So it seems we don't resolve the path here. We should.

>All comments

I assumed that complete -p /home/auser/myscript -f -a 'dosomething dosomethingelse' -d "Some comment" should do this but I do not get autocomplete options when typing ./myscript or /home/auser/myscript .

This works for me with the full path (or via $PATH, if it's in), but not the relative ./.

So it seems we don't resolve the path here. We should.

Was this page helpful?
0 / 5 - 0 ratings