]> arthur.barton.de Git - ax-zsh.git/commitdiff
Add axzshctl subcommand "list-enabled"
authorAlexander Barton <alex@barton.de>
Wed, 26 Oct 2016 08:38:18 +0000 (10:38 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 26 Oct 2016 08:38:18 +0000 (10:38 +0200)
bin/axzshctl
core/50_axzsh/functions/_axzsh

index b5dfb7244e32d288d666854e42d247ba559c0c54..8298743a5a13bce228e173dccc16f34fb30c7443 100755 (executable)
@@ -23,22 +23,20 @@ function Usage {
        echo
        echo "  enable"
        echo "    Enable AX-ZSH altogether."
-       echo
        echo "  disable"
        echo "    Disable AX-ZSH altogether."
        echo
        echo "  enable-plugin <name|directory> [<name|directory> [...]]"
        echo "    Enable plugin(s)."
-       echo
        echo "  disable-plugin <name> [<name> [...]]"
        echo "    Disable plugin(s)."
+       echo "  list-enabled"
+       echo "    List enabled plugins."
        echo
        echo "  reset-plugins"
        echo "    Reset active plugins to the default set."
-       echo
        echo "  enable-default-plugins"
        echo "    Enable all default plugins."
-       echo
        echo "  check-plugins"
        echo "    Detect plugins which are \"useful\" on this system."
        echo
@@ -136,6 +134,13 @@ function DisablePlugin {
        return $r
 }
 
+function ListEnabledPlugins {
+       for plugin ($AXZSH/active_plugins/*(N)); do
+               print ${plugin:t:s/#/\//}
+       done
+       return 0
+}
+
 function ResetPlugins {
        local dir="$AXZSH/active_plugins"
        local r1=0, r2=0
@@ -323,6 +328,10 @@ case "$cmd" in
                        DisablePlugin "$plugin"
                done
                ;;
+       "list-enabled")
+               [[ $# -eq 0 ]] || Usage
+               ListEnabledPlugins
+               ;;
        "reset-plugins")
                [[ $# -eq 0 ]] || Usage
                ResetPlugins
index 014221406f8d4da655e5fd448a7f1b3694dcff19..2a62f29364ba8f4548a95fdabc694a94809d7fbb 100644 (file)
@@ -7,6 +7,7 @@ _axzshctl() {
                        disable\:"Disable AX-ZSH."
                        enable-plugin\:"Enable plugin(s)."
                        disable-plugin\:"Disable plugin(s)."
+                       list-enabled\:"List enabled plugin(s)."
                        reset-plugins\:"Reset active plugins to the default set."
                        enable-default-plugins\:"Enable all default plugins."
                        check-plugins\:"Check \"useful\" plugins."