fork/fish-shell

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

rosaviAdd completions for cpan and t-recc7262d6c0

master
2.8 KiB45 linesraw
1# fish completion for Perl's cpan
2
3function __fish_cpan_list_installed_modules
4    # Following IRC's #fish suggestion to use </dev/null as cpan might go interactive
5    cpan -l </dev/null | while read -l line
6        # Filter out unrelated messages or notifications
7        if string match -qr -- '^\w.*\t\w.*$' $line
8            string replace -r -- '\t.*' '' $line |
9                string escape --style=script
10        end
11    end
12end
13
14complete -c cpan -s a -d "Creates a CPAN.pm autobundle with CPAN::Shell->autobundle"
15complete -c cpan -s A -d "Show primary maintainer for specified module" -xa "(__fish_cpan_list_installed_modules)"
16complete -c cpan -s c -d "Runs a `make clean` in the specified modules directories"
17complete -c cpan -s C -d "Show the Changes files for specified module" -a "(__fish_cpan_list_installed_modules)"
18complete -c cpan -s D -d "Show module details" -a "(__fish_cpan_list_installed_modules)"
19complete -c cpan -s f -d "Force the specified action"
20complete -c cpan -s F -d "Turn off CPAN.pm's attempts to lock anything"
21complete -c cpan -s g -d "Download latest distribution of module to current directory" -a "(__fish_cpan_list_installed_modules)"
22# complete -c cpan -s G -d "UNIMPLEMENTED"
23complete -c cpan -s h -d "Print a help message and exit"
24complete -c cpan -s i -d "Install specified module"
25complete -c cpan -s I -d "Load 'local::lib' (think like '-I' for loading lib paths)"
26complete -c cpan -s j -d "Load file with CPAN configuration data"
27complete -c cpan -s J -d "Dump the configuration in the same format that CPAN.pm uses"
28complete -c cpan -s l -d "list all installed modules with their versions"
29complete -c cpan -s L -d "List the modules by the specified authors"
30complete -c cpan -s m -d "Make the specified modules"
31complete -c cpan -s M -d "Comma-separated list of mirrors to use for this run" -x
32#complete -c cpan -s n -d "Do a dry run, but dont actually install anything. (unimplemented)"
33complete -c cpan -s O -d "Show the out-of-date modules"
34complete -c cpan -s p -d "Ping the configured mirrors and print a report"
35complete -c cpan -s P -d "Find and the best mirrors available"
36complete -c cpan -s r -d "Recompiles dynamically loaded modules with CPAN::Shell->recompile"
37complete -c cpan -s s -d "Drop in the CPAN.pm shell"
38complete -c cpan -s t -d "Run a `make test` on the specified modules"
39complete -c cpan -s T -d "Do not test modules. Simply install them"
40complete -c cpan -s u -d "Upgrade all installed modules"
41complete -c cpan -s v -d "Print the script version and CPAN.pm version then exit"
42complete -c cpan -s V -d "Print detailed information about the cpan client"
43# complete -c cpan -s w -d "UNIMPLEMENTED"
44complete -c cpan -s x -d "Find close matches to named module. Requires Text::Levenshtein or others"
45complete -c cpan -s X -d "Dump all the namespaces to standard output"