~yerinalexey/miniplug

def53013a61a9e1b83bf9ac60efea1c61515bd9c — Alexey Yerin 1 year, 2 months ago f0a343a
Add base for registering plugins
1 files changed, 14 insertions(+), 0 deletions(-)

M miniplug.zsh
M miniplug.zsh => miniplug.zsh +14 -0
@@ 2,22 2,36 @@

# Miniplug - minimalistic plugin manager for ZSH

# Globals
declare MINIPLUG_HOME="${MINIPLUG_HOME:-$HOME/.miniplug}"
declare MINIPLUG_PLUGINS=()

# Helper functions {{{

# }}}

# Core functions {{{
# Show help message
function __miniplug_usage() {
  echo "Miniplug - minimalistic plugin manager for ZSH"
  echo "Usage: miniplug <command> [arguments]"
  echo "Commands:"
  echo "  plugin - Register a plugin"
  echo "  help - Show this message"
}

# Register a plugin
function __miniplug_plugin() {
  local plugin_url="$1"

  MINIPLUG_PLUGINS+=("$plugin_url")
}
# }}}

# Wrapper command for core functions
function miniplug() {
  case "$1" in
    plugin) __miniplug_plugin "$2" ;;
    help) __miniplug_usage ;;
    *) __miniplug_usage ;;
  esac