mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Docs for asdf
This commit is contained in:
parent
2bd92aef75
commit
2fe941fb4c
48
README.md
48
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 <package> <version>
|
||||
asdf package uninstall <package> <version>
|
||||
asdf package installed <package>
|
||||
asdf package available <package>
|
||||
asdf package use <package> <version>
|
||||
asdf source add <package> <source>
|
||||
asdf source remove <package>
|
||||
asdf source update --all
|
||||
asdf source update <package>
|
||||
|
8
bin/asdf
8
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
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
ASDF_DIR=$(dirname $0)
|
||||
|
||||
asdf_version () {
|
||||
echo "0.1"
|
||||
}
|
||||
|
||||
run_command () {
|
||||
echo $1
|
||||
echo $2
|
||||
|
74
lib/asdf/docs.sh
Normal file
74
lib/asdf/docs.sh
Normal file
@ -0,0 +1,74 @@
|
||||
help_install () {
|
||||
echo "asdf install <package> <version>"
|
||||
echo "\tInstall the specified version of the package"
|
||||
}
|
||||
|
||||
help_uninstall () {
|
||||
echo "asdf uninstall <package> <version>"
|
||||
echo "\tUninstall the specified version of the package"
|
||||
}
|
||||
|
||||
help_installed () {
|
||||
echo "asdf installed <package>"
|
||||
echo "\tList the installed versions of the package"
|
||||
}
|
||||
|
||||
help_available () {
|
||||
echo "asdf available <package>"
|
||||
echo "\tList all the available versions of the package"
|
||||
}
|
||||
|
||||
help_use () {
|
||||
echo "asdf use <package> <version>"
|
||||
echo "\tUse the specified version of the package for the current shell environment"
|
||||
}
|
||||
|
||||
help_source_add () {
|
||||
echo "asdf source add <package> <repo>"
|
||||
echo "\tAdd the git repo as the source for the package"
|
||||
}
|
||||
|
||||
help_source_remove () {
|
||||
echo "asdf source remove <package>"
|
||||
echo "\tRemove the source for the package"
|
||||
}
|
||||
|
||||
help_source_update () {
|
||||
echo "asdf source update <package>"
|
||||
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
|
||||
}
|
7
lib/asdf/utils.sh
Normal file
7
lib/asdf/utils.sh
Normal file
@ -0,0 +1,7 @@
|
||||
help_title () {
|
||||
echo $1
|
||||
}
|
||||
|
||||
help_desc () {
|
||||
echo $1
|
||||
}
|
Loading…
Reference in New Issue
Block a user