fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerFix stale name of --tokens-expand option33a9659cd

master
951 B25 linesraw
1function __fish_qdbus_complete
2    argparse system 'bus=' literal help -- (commandline --cut-at-cursor --tokens-expanded) 2>/dev/null
3    or return
4    if set -q _flag_help
5        return
6    end
7    set -l qdbus_flags $_flag_system
8    if set -q _flag_bus
9        set -a qdbus_flags --bus $_flag_bus
10    end
11    set argc (count $argv)
12    if test $argc -le 3
13        # avoid completion of property value
14        qdbus $qdbus_flags $argv[2] $argv[3] | string replace --regex '^(?<kind>property\ (read)?(write)?|signal|method( Q_NOREPLY)?) (?<type>(\{.+\})|([^\ ]+)) (?<name>[^\(]+)(?<arguments>\(.+?\))?' '$name\t$kind $type $arguments' | string trim
15    end
16end
17
18complete -c qdbus -f
19
20complete -c qdbus -l system -d 'connect to the system bus'
21complete -c qdbus -l bus -r -d 'connect to a custom bus'
22complete -c qdbus -l literal -d 'print replies literally'
23complete -c qdbus -l help -d 'print usage'
24
25complete -c qdbus -a '(__fish_qdbus_complete)'