Browse code

Merge pull request #30945 from sdurrheimer/zsh-completion-plugin

Add zsh completion for missing 'docker plugin' commands and options
(cherry picked from commit da9a162301e36b7aa9a4925657f8c28121b11125)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Brian Goff authored on 2017/02/15 05:57:25
Showing 1 changed files
... ...
@@ -1561,6 +1561,7 @@ __docker_plugin_commands() {
1561 1561
         "push:Push a plugin"
1562 1562
         "rm:Remove a plugin"
1563 1563
         "set:Change settings for a plugin"
1564
+        "upgrade:Upgrade an existing plugin"
1564 1565
     )
1565 1566
     _describe -t docker-plugin-commands "docker plugin command" _docker_plugin_subcommands
1566 1567
 }
... ...
@@ -1573,22 +1574,65 @@ __docker_plugin_subcommand() {
1573 1573
     opts_help=("(: -)--help[Print usage]")
1574 1574
 
1575 1575
     case "$words[1]" in
1576
-        (disable|enable|inspect|ls|push|rm)
1576
+        (disable)
1577 1577
             _arguments $(__docker_arguments) \
1578 1578
                 $opts_help \
1579
+                "($help -f --force)"{-f,--force}"[Force the disable of an active plugin]" \
1579 1580
                 "($help -)1:plugin:__docker_complete_plugins" && ret=0
1580 1581
             ;;
1582
+        (enable)
1583
+            _arguments $(__docker_arguments) \
1584
+                $opts_help \
1585
+                "($help)--timeout=[HTTP client timeout (in seconds)]:timeout: " \
1586
+                "($help -)1:plugin:__docker_complete_plugins" && ret=0
1587
+            ;;
1588
+        (inspect)
1589
+            _arguments $(__docker_arguments) \
1590
+                $opts_help \
1591
+                "($help -f --format)"{-f=,--format=}"[Format the output using the given Go template]:template: " \
1592
+                "($help -)*:plugin:__docker_complete_plugins" && ret=0
1593
+            ;;
1581 1594
         (install)
1582 1595
             _arguments $(__docker_arguments) \
1583 1596
                 $opts_help \
1584 1597
                 "($help)--alias=[Local name for plugin]:alias: " \
1598
+                "($help)--disable[Do not enable the plugin on install]" \
1599
+                "($help)--disable-content-trust[Skip image verification (default true)]" \
1600
+                "($help)--grant-all-permissions[Grant all permissions necessary to run the plugin]" \
1601
+                "($help -)1:plugin:__docker_complete_plugins" \
1602
+                "($help -)*:key=value: " && ret=0
1603
+            ;;
1604
+        (ls|list)
1605
+            _arguments $(__docker_arguments) \
1606
+                $opts_help \
1607
+                "($help)--no-trunc[Don't truncate output]" && ret=0
1608
+            ;;
1609
+        (push)
1610
+            _arguments $(__docker_arguments) \
1611
+                $opts_help \
1612
+                "($help)--disable-content-trust[Skip image verification (default true)]" \
1585 1613
                 "($help -)1:plugin:__docker_complete_plugins" && ret=0
1586 1614
             ;;
1615
+        (rm|remove)
1616
+            _arguments $(__docker_arguments) \
1617
+                $opts_help \
1618
+                "($help -f --force)"{-f,--force}"[Force the removal of an active plugin]" \
1619
+                "($help -)*:plugin:__docker_complete_plugins" && ret=0
1620
+            ;;
1587 1621
         (set)
1588 1622
             _arguments $(__docker_arguments) \
1589 1623
                 $opts_help \
1590 1624
                 "($help -)1:plugin:__docker_complete_plugins" \
1591
-                "($help-)*:key=value: " && ret=0
1625
+                "($help -)*:key=value: " && ret=0
1626
+            ;;
1627
+        (upgrade)
1628
+            _arguments $(__docker_arguments) \
1629
+                $opts_help \
1630
+                "($help)--disable-content-trust[Skip image verification (default true)]" \
1631
+                "($help)--grant-all-permissions[Grant all permissions necessary to run the plugin]" \
1632
+                "($help)--skip-remote-check[Do not check if specified remote plugin matches existing plugin image]" \
1633
+                "($help -)1:plugin:__docker_complete_plugins" \
1634
+                "($help -):remote: " && ret=0
1592 1635
             ;;
1593 1636
         (help)
1594 1637
             _arguments $(__docker_arguments) ":subcommand:__docker_plugin_commands" && ret=0