]> arthur.barton.de Git - ax-zsh.git/blobdiff - bin/axzshctl
Add axzshctl subcommand "list-enabled"
[ax-zsh.git] / bin / axzshctl
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