diff --git a/README.md b/README.md index 18f7a155..f5620faf 100644 --- a/README.md +++ b/README.md @@ -5,42 +5,12 @@ ## Commands -#### Install verison 1.2.3 of xyz - -``` -asdf install xyz 1.2.3 --name 1.0.0-erl-17.3 -``` - -#### Uninstall version 1.2.3 of xyz - -``` -asdf uninstall xyz 1.2.3 -``` - -#### List installed versions of xyz - -``` -asdf list xyz -``` - -#### List all available versions of xyz - -``` -asdf list xyz --all -``` - -#### Add a tool - -``` -asdf add elixir HashNuke/asdf-elixir -``` - -#### List all tool sources added - -``` -asdf list -``` - -#### erlang 17.3 1.0.0-erl-17.3 - -asdf depend elixir 1.0.0 on java 1.0 +asdf package install +asdf package uninstall +asdf package installed +asdf package available +asdf package use +asdf source add +asdf source remove +asdf source update --all +asdf source update diff --git a/bin/asdf b/bin/asdf index ec6597ec..a8789dc3 100755 --- a/bin/asdf +++ b/bin/asdf @@ -1,4 +1,8 @@ -#!/usr/bin/env sh +#!/usr/bin/env sh -l +source $(dirname $(dirname $0))/lib/asdf/utils.sh source $(dirname $(dirname $0))/lib/asdf.sh -run_command $@ +source $(dirname $(dirname $0))/lib/asdf/docs.sh + +# run_command $@ +help_all diff --git a/lib/asdf.sh b/lib/asdf.sh index 6f7951c6..48fec544 100644 --- a/lib/asdf.sh +++ b/lib/asdf.sh @@ -6,6 +6,10 @@ ASDF_DIR=$(dirname $0) +asdf_version () { + echo "0.1" +} + run_command () { echo $1 echo $2 diff --git a/lib/asdf/docs.sh b/lib/asdf/docs.sh new file mode 100644 index 00000000..0748526b --- /dev/null +++ b/lib/asdf/docs.sh @@ -0,0 +1,74 @@ +help_install () { + echo "asdf install " + echo "\tInstall the specified version of the package" +} + +help_uninstall () { + echo "asdf uninstall " + echo "\tUninstall the specified version of the package" +} + +help_installed () { + echo "asdf installed " + echo "\tList the installed versions of the package" +} + +help_available () { + echo "asdf available " + echo "\tList all the available versions of the package" +} + +help_use () { + echo "asdf use " + echo "\tUse the specified version of the package for the current shell environment" +} + +help_source_add () { + echo "asdf source add " + echo "\tAdd the git repo as the source for the package" +} + +help_source_remove () { + echo "asdf source remove " + echo "\tRemove the source for the package" +} + +help_source_update () { + echo "asdf source update " + echo "\tUpdate the package's source" +} + +help_source_update_all () { + echo "asdf source update --all" + echo "\tUpdate the sources of all packages" +} + +help_help () { + echo "asdf help" + echo "\tDisplay this help message" +} + + +help_all () { + commands_to_run=( + help_install + help_uninstall + help_installed + help_available + help_use + help_source_add + help_source_remove + help_source_update + help_source_update_all + help_help + ) + + echo "version: $(asdf_version)" + echo + + for command in "${commands_to_run[@]}" + do + eval $command + echo + done +} diff --git a/lib/asdf/utils.sh b/lib/asdf/utils.sh new file mode 100644 index 00000000..515678fc --- /dev/null +++ b/lib/asdf/utils.sh @@ -0,0 +1,7 @@ +help_title () { + echo $1 +} + +help_desc () { + echo $1 +}