22# Place in ~/.config/fish/completions/phpenv.fish
33
44# Complete main commands
5- complete -c phpenv -f -n " __fish_use_subcommand" -a " install" -d " Install a PHP version"
6- complete -c phpenv -f -n " __fish_use_subcommand" -a " uninstall" -d " Uninstall a PHP version"
7- complete -c phpenv -f -n " __fish_use_subcommand" -a " use" -d " Use PHP version for current shell"
8- complete -c phpenv -f -n " __fish_use_subcommand" -a " local" -d " Set PHP version for current project"
9- complete -c phpenv -f -n " __fish_use_subcommand" -a " global" -d " Set global PHP version"
10- complete -c phpenv -f -n " __fish_use_subcommand" -a " list" -d " List installed PHP versions"
11- complete -c phpenv -f -n " __fish_use_subcommand" -a " ls " -d " List installed PHP versions"
12- complete -c phpenv -f -n " __fish_use_subcommand" -a " current" -d " Show current PHP version"
13- complete -c phpenv -f -n " __fish_use_subcommand" -a " which" -d " Show path to PHP binary"
14- complete -c phpenv -f -n " __fish_use_subcommand" -a " versions" -d " Show all available versions"
15- complete -c phpenv -f -n " __fish_use_subcommand" -a " doctor" -d " Check phpenv installation"
16- complete -c phpenv -f -n " __fish_use_subcommand" -a " config" -d " Manage configuration"
17- complete -c phpenv -f -n " __fish_use_subcommand" -a " extensions" -d " Manage PHP extensions"
18- complete -c phpenv -f -n " __fish_use_subcommand" -a " ext" -d " Manage PHP extensions"
19- complete -c phpenv -f -n " __fish_use_subcommand" -a " help" -d " Show help"
5+ complete -c phpenv -f -n __fish_use_subcommand -a install -d " Install a PHP version"
6+ complete -c phpenv -f -n __fish_use_subcommand -a uninstall -d " Uninstall a PHP version"
7+ complete -c phpenv -f -n __fish_use_subcommand -a use -d " Use PHP version for current shell"
8+ complete -c phpenv -f -n __fish_use_subcommand -a local -d " Set PHP version for current project"
9+ complete -c phpenv -f -n __fish_use_subcommand -a global -d " Set global PHP version"
10+ complete -c phpenv -f -n __fish_use_subcommand -a list -d " List installed PHP versions"
11+ complete -c phpenv -f -n __fish_use_subcommand -a ls -d " List installed PHP versions"
12+ complete -c phpenv -f -n __fish_use_subcommand -a current -d " Show current PHP version"
13+ complete -c phpenv -f -n __fish_use_subcommand -a which -d " Show path to PHP binary"
14+ complete -c phpenv -f -n __fish_use_subcommand -a versions -d " Show all available versions"
15+ complete -c phpenv -f -n __fish_use_subcommand -a doctor -d " Check phpenv installation"
16+ complete -c phpenv -f -n __fish_use_subcommand -a config -d " Manage configuration"
17+ complete -c phpenv -f -n __fish_use_subcommand -a extensions -d " Manage PHP extensions"
18+ complete -c phpenv -f -n __fish_use_subcommand -a ext -d " Manage PHP extensions"
19+ complete -c phpenv -f -n __fish_use_subcommand -a help -d " Show help"
2020
2121# Helper functions for completions
2222function __phpenv_complete_installed_versions
2626function __phpenv_complete_available_versions
2727 # Try to get dynamic versions first
2828 if command -q curl -a command -q jq; and functions -q __phpenv_parse_version_field
29- echo " latest"
30- echo " nightly"
29+ echo latest
30+ echo nightly
3131 echo " 5.x"
3232 echo " 7.x"
3333 echo " 8.x"
34- __phpenv_parse_version_field " latest" " 8.4"
35- __phpenv_parse_version_field " nightly" " 8.5"
34+ __phpenv_parse_version_field latest " 8.4"
35+ __phpenv_parse_version_field nightly " 8.5"
3636 __phpenv_parse_version_field " 5.x" " 5.6"
3737 __phpenv_parse_version_field " 7.x" " 7.4"
3838 __phpenv_parse_version_field " 8.x" " 8.4"
@@ -64,18 +64,18 @@ complete -c phpenv -f -n "__fish_seen_subcommand_from uninstall use local global
6464 -a " (__phpenv_complete_installed_versions)" -d " Installed PHP version"
6565
6666# Add system option for use command
67- complete -c phpenv -f -n " __fish_seen_subcommand_from use" -a " system" -d " Use system PHP"
67+ complete -c phpenv -f -n " __fish_seen_subcommand_from use" -a system -d " Use system PHP"
6868
6969# Complete binaries for which command
7070complete -c phpenv -f -n " __fish_seen_subcommand_from which" -a " (__phpenv_complete_binaries)" -d " PHP binary"
7171
7272# Complete config subcommands
7373complete -c phpenv -f -n " __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
74- -a " get" -d " Get configuration value"
74+ -a get -d " Get configuration value"
7575complete -c phpenv -f -n " __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
76- -a " set" -d " Set configuration value"
76+ -a set -d " Set configuration value"
7777complete -c phpenv -f -n " __fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set list" \
78- -a " list" -d " List all configuration"
78+ -a list -d " List all configuration"
7979
8080# Complete config keys
8181complete -c phpenv -f -n " __fish_seen_subcommand_from config; and __fish_seen_subcommand_from get set" \
@@ -91,27 +91,27 @@ complete -c phpenv -f \
9191complete -c phpenv -f \
9292 -n " __fish_seen_subcommand_from extensions ext" \
9393 -n " not __fish_seen_subcommand_from install uninstall remove list ls available" \
94- -a " install" -d " Install PHP extension"
94+ -a install -d " Install PHP extension"
9595complete -c phpenv -f \
9696 -n " __fish_seen_subcommand_from extensions ext" \
9797 -n " not __fish_seen_subcommand_from install uninstall remove list ls available" \
98- -a " uninstall" -d " Uninstall PHP extension"
98+ -a uninstall -d " Uninstall PHP extension"
9999complete -c phpenv -f \
100100 -n " __fish_seen_subcommand_from extensions ext" \
101101 -n " not __fish_seen_subcommand_from install uninstall remove list ls available" \
102- -a " remove" -d " Remove PHP extension"
102+ -a remove -d " Remove PHP extension"
103103complete -c phpenv -f \
104104 -n " __fish_seen_subcommand_from extensions ext" \
105105 -n " not __fish_seen_subcommand_from install uninstall remove list ls available" \
106- -a " list" -d " List installed extensions"
106+ -a list -d " List installed extensions"
107107complete -c phpenv -f \
108108 -n " __fish_seen_subcommand_from extensions ext" \
109109 -n " not __fish_seen_subcommand_from install uninstall remove list ls available" \
110- -a " ls " -d " List installed extensions"
110+ -a ls -d " List installed extensions"
111111complete -c phpenv -f \
112112 -n " __fish_seen_subcommand_from extensions ext" \
113113 -n " not __fish_seen_subcommand_from install uninstall remove list ls available" \
114- -a " available" -d " Show available extensions"
114+ -a available -d " Show available extensions"
115115
116116# Complete extension names
117117complete -c phpenv -f \
0 commit comments