mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-25 05:17:11 -07:00
Describes static command options.
Resolves issue #15. Also makes completion specifications more readable (ymmv).
This commit is contained in:
parent
08404e48fa
commit
74924f8961
1 changed files with 110 additions and 43 deletions
|
@ -99,72 +99,139 @@ end
|
|||
complete -c sdk -f -n '__fish_sdkman_sdk_is_missing'
|
||||
|
||||
# install
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'i install' -d 'Install new version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command i install' -a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' -a "a.b.c x.y.z" -d "version list unavailable"
|
||||
# TODO complete available versions --> #4
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 i install' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'i install' \
|
||||
-d 'Install new version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command i install' \
|
||||
-a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \
|
||||
-a "a.b.c x.y.z" -d "version list unavailable"
|
||||
# TODO complete available versions --> #4
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 i install'
|
||||
# block
|
||||
|
||||
# uninstall
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'rm uninstall' -d 'Uninstall version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command rm uninstall' -a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate rm uninstall' -a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 rm uninstall' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'rm uninstall' -d 'Uninstall version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command rm uninstall' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate rm uninstall' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 rm uninstall'
|
||||
# block
|
||||
|
||||
# list
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'ls list' -d 'List versions'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command ls list' -a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ls list' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'ls list' \
|
||||
-d 'List versions'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command ls list' \
|
||||
-a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ls list'
|
||||
# block
|
||||
|
||||
# use
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'u use' -d 'Use specific version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command u use' -a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate u use' -a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 u use' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'u use' \
|
||||
-d 'Use specific version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command u use' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate u use' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 u use'
|
||||
# block
|
||||
|
||||
# default
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'd default' -d 'Set default version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command d default' -a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate d default' -a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 d default' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'd default' \
|
||||
-d 'Set default version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command d default' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate d default' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 d default'
|
||||
# block
|
||||
|
||||
# current
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'c current' -d 'Display current version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command c current' -a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 c current' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'c current' \
|
||||
-d 'Display current version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command c current' \
|
||||
-a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 c current'
|
||||
# block
|
||||
|
||||
# upgrade
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'ug upgrade' -d 'Display what is outdated'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command ug upgrade' -a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ug upgrade' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'ug upgrade' \
|
||||
-d 'Display what is outdated'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command ug upgrade' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ug upgrade'
|
||||
# block
|
||||
|
||||
# version
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'v version' -d 'Display version'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 v version' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'v version' \
|
||||
-d 'Display version'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 v version'
|
||||
# block
|
||||
|
||||
# broadcast
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'b broadcast' -d 'Display broadcast message'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 b broadcast' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'b broadcast' \
|
||||
-d 'Display broadcast message'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 b broadcast'
|
||||
# block
|
||||
|
||||
# help
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'h help' -d 'Display help message'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 h help' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'h help' \
|
||||
-d 'Display help message'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 h help'
|
||||
# block
|
||||
|
||||
# offline
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'offline' -d 'Set offline status'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command offline' -a 'enable disable'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 offline' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'offline' \
|
||||
-d 'Set offline status'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command offline' \
|
||||
-a 'enable' \
|
||||
-d 'Make sdk work while offline'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command offline' \
|
||||
-a 'disable' \
|
||||
-d 'Turn on all features'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 offline'
|
||||
# block
|
||||
|
||||
# selfupdate
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'selfupdate' -d 'Update sdkman'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command selfupdate' -a 'force' # TODO: add description
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 selfupdate' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'selfupdate' \
|
||||
-d 'Update sdk'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command selfupdate' \
|
||||
-a 'force' \
|
||||
-d 'Force re-install of current version'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 selfupdate'
|
||||
# block
|
||||
|
||||
# update
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'update' -d 'Reload the candidate list'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 update' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'update' \
|
||||
-d 'Reload the candidate list'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 update'
|
||||
# block
|
||||
|
||||
# flush
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' -a 'flush' -d 'Clear out cache'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command flush' -a 'broadcast archives temp'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 flush' # block
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'flush' \
|
||||
-d 'Clear out caches'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command flush' \
|
||||
-a 'broadcast' \
|
||||
-d 'Re-download news'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command flush' \
|
||||
-a 'archives' \
|
||||
-d 'Remove downloads'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command flush' \
|
||||
-a 'temp' \
|
||||
-d 'Clear installation prep folder'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 flush'
|
||||
# block
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue