forked from exercism/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request exercism#806 from QuLogic/zsh-fpath
Make zsh completion work on $fpath.
- Loading branch information
Showing
2 changed files
with
39 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
_exercism() { | ||
local curcontext="$curcontext" state line | ||
typeset -A opt_args | ||
#compdef exercism | ||
|
||
local -a options | ||
options=(configure:"Writes config values to a JSON file." | ||
download:"Downloads and saves a specified submission into the local system" | ||
open:"Opens a browser to exercism.io for the specified submission." | ||
submit:"Submits a new iteration to a problem on exercism.io." | ||
troubleshoot:"Outputs useful debug information." | ||
upgrade:"Upgrades to the latest available version." | ||
version:"Outputs version information." | ||
workspace:"Outputs the root directory for Exercism exercises." | ||
help:"Shows a list of commands or help for one command") | ||
local curcontext="$curcontext" state line | ||
typeset -A opt_args | ||
|
||
_arguments -s -S \ | ||
{-h,--help}"[show help]" \ | ||
{-t,--timeout}"[override default HTTP timeout]" \ | ||
{-v,--verbose}"[turn on verbose logging]" \ | ||
'(-): :->command' \ | ||
'(-)*:: :->option-or-argument' \ | ||
&& return 0; | ||
local -a options | ||
options=(configure:"Writes config values to a JSON file." | ||
download:"Downloads and saves a specified submission into the local system" | ||
open:"Opens a browser to exercism.io for the specified submission." | ||
submit:"Submits a new iteration to a problem on exercism.io." | ||
troubleshoot:"Outputs useful debug information." | ||
upgrade:"Upgrades to the latest available version." | ||
version:"Outputs version information." | ||
workspace:"Outputs the root directory for Exercism exercises." | ||
help:"Shows a list of commands or help for one command") | ||
|
||
case $state in | ||
(command) | ||
_describe 'commands' options ;; | ||
(option-or-argument) | ||
case $words[1] in | ||
s*) | ||
_files | ||
;; | ||
esac | ||
esac | ||
} | ||
_arguments -s -S \ | ||
{-h,--help}"[show help]" \ | ||
{-t,--timeout}"[override default HTTP timeout]" \ | ||
{-v,--verbose}"[turn on verbose logging]" \ | ||
'(-): :->command' \ | ||
'(-)*:: :->option-or-argument' \ | ||
&& return 0; | ||
|
||
compdef '_exercism' exercism | ||
case $state in | ||
(command) | ||
_describe 'commands' options ;; | ||
(option-or-argument) | ||
case $words[1] in | ||
s*) | ||
_files | ||
;; | ||
esac | ||
esac |