Skip to content

Commit c5c202e

Browse files
author
Katrina Owen
authored
Merge pull request exercism#763 from John-Goff/fish-completions
Fish tab completions
2 parents acc3a6e + 5266925 commit c5c202e

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

shell/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ the following snippet
3131
#### Oh my Zsh
3232

3333
If you are using the popular [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) framework to manage your zsh plugins, move the file `exercism_completion.zsh` into `~/.oh-my-zsh/custom`.
34+
35+
### Fish
36+
37+
Completions must go in the user defined `$fish_complete_path`. By default, this is `~/.config/fish/completions`
38+
39+
mv ../shell/exercism.fish ~/.config/fish/exercism.fish
40+

shell/exercism.fish

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Configure
2+
complete -f -c exercism -n "__fish_use_subcommand" -a "configure" -d "Writes config values to a JSON file."
3+
complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s t -l token -d "Set token"
4+
complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s w -l workspace -d "Set workspace"
5+
complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s a -l api -d "set API base url"
6+
complete -f -c exercism -n "__fish_seen_subcommand_from configure" -s s -l show -d "show settings"
7+
8+
# Download
9+
complete -f -c exercism -n "__fish_use_subcommand" -a "download" -d "Downloads and saves a specified submission into the local system"
10+
complete -f -c exercism -n "__fish_seen_subcommand_from download" -s e -l exercise -d "the exercise slug"
11+
complete -f -c exercism -n "__fish_seen_subcommand_from download" -s h -l help -d "help for download"
12+
complete -f -c exercism -n "__fish_seen_subcommand_from download" -s T -l team -d "the team slug"
13+
complete -f -c exercism -n "__fish_seen_subcommand_from download" -s t -l track -d "the track ID"
14+
complete -f -c exercism -n "__fish_seen_subcommand_from download" -s u -l uuid -d "the solution UUID"
15+
16+
# Help
17+
complete -f -c exercism -n "__fish_use_subcommand" -a "help" -d "Shows a list of commands or help for one command"
18+
complete -f -c exercism -n "__fish_seen_subcommand_from help" -a "configure download help open submit troubleshoot upgrade version workspace"
19+
20+
# Open
21+
complete -f -c exercism -n "__fish_use_subcommand" -a "open" -d "Opens a browser to exercism.io for the specified submission."
22+
complete -f -c exercism -n "__fish_seen_subcommand_from open" -s h -l help -d "help for open"
23+
24+
# Submit
25+
complete -f -c exercism -n "__fish_use_subcommand" -a "submit" -d "Submits a new iteration to a problem on exercism.io."
26+
complete -f -c exercism -n "__fish_seen_subcommand_from submit" -s h -l help -d "help for submit"
27+
28+
# Troubleshoot
29+
complete -f -c exercism -n "__fish_use_subcommand" -a "troubleshoot" -d "Outputs useful debug information."
30+
complete -f -c exercism -n "__fish_seen_subcommand_from troubleshoot" -s f -l full-api-key -d "display full API key (censored by default)"
31+
complete -f -c exercism -n "__fish_seen_subcommand_from troubleshoot" -s h -l help -d "help for troubleshoot"
32+
33+
# Upgrade
34+
complete -f -c exercism -n "__fish_use_subcommand" -a "upgrade" -d "Upgrades to the latest available version."
35+
complete -f -c exercism -n "__fish_seen_subcommand_from help" -s h -l help -d "help for help"
36+
37+
# Version
38+
complete -f -c exercism -n "__fish_use_subcommand" -a "version" -d "Outputs version information."
39+
complete -f -c exercism -n "__fish_seen_subcommand_from version" -s l -l latest -d "check latest available version"
40+
complete -f -c exercism -n "__fish_seen_subcommand_from version" -s h -l help -d "help for version"
41+
42+
# Workspace
43+
complete -f -c exercism -n "__fish_use_subcommand" -a "workspace" -d "Outputs the root directory for Exercism exercises."
44+
complete -f -c exercism -n "__fish_seen_subcommand_from workspace" -s h -l help -d "help for workspace"
45+
46+
# Options
47+
complete -f -c exercism -s h -l help -d "show help"
48+
complete -f -c exercism -l timeout -a "10" -d "10 seconds"
49+
complete -f -c exercism -l timeout -a "30" -d "30 seconds"
50+
complete -f -c exercism -l timeout -a "60" -d "1 minute"
51+
complete -f -c exercism -l timeout -a "300" -d "5 minutes"
52+
complete -f -c exercism -l timeout -a "600" -d "10 minutes"
53+
complete -f -c exercism -l timeout -a "" -d "override default HTTP timeout"
54+
complete -f -c exercism -s v -l verbose -d "turn on verbose logging"

0 commit comments

Comments
 (0)