1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

Improved help system.

Signed-off-by: Tony Tkacik <tonydamage@gmail.com>
This commit is contained in:
Tony Tkáčik 2017-06-20 15:55:07 +02:00
parent ff4e509d1c
commit 89010fd209
9 changed files with 233 additions and 133 deletions

View file

@ -1,30 +1,30 @@
#!/usr/bin/env nux-runner
### # nuxfs - Filesystem layout manager
###
### *nuxfs* command uses file structure definition present in *.nuxfs* file
### to understand intented state of directory / filesystem of user.
###
### This definition is not only used to create filesystem hierarchy, checkout
### git repositories but also to verify state of filesystem afterwards.
###
### ## Example of .nuxfs file in home directory
###
### *dir* github
### *git* nux-env https://github.com/tonydamage/nux-env.git
### *git* bats https://github.com/sstephenson/bats.git
### *enddir*
### *link* .bashrc github/nux-env/bashrc
###
### This *.nuxfs* file describes simple home structure. If we execute
### **nuxfs apply** command, it will performs filesystem changes in order to
### recreate structure described in *.nuxfs* file. In case of example it is
### equivalent of executing:
### mkdir -p github
### git clone https://github.com/tonydamage/nux-env.git github/nux-env
### git clone https://github.com/sstephenson/bats.git
### ln -s github/nux-env/bashrc .bashrc
###
## # nuxfs - Filesystem layout manager
##
## *nuxfs* command uses file structure definition present in *.nuxfs* file
## to understand intented state of directory / filesystem of user.
##
## This definition is not only used to create filesystem hierarchy, checkout
## git repositories but also to verify state of filesystem afterwards.
##
## ## Example of .nuxfs file in home directory
##
## *dir* github
## *git* nux-env https://github.com/tonydamage/nux-env.git
## *git* bats https://github.com/sstephenson/bats.git
## *enddir*
## *link* .bashrc github/nux-env/bashrc
##
## This *.nuxfs* file describes simple home structure. If we execute
## **nuxfs apply** command, it will performs filesystem changes in order to
## recreate structure described in *.nuxfs* file. In case of example it is
## equivalent of executing:
## mkdir -p github
## git clone https://github.com/tonydamage/nux-env.git github/nux-env
## git clone https://github.com/sstephenson/bats.git
## ln -s github/nux-env/bashrc .bashrc
##
local WORKDIR=$(pwd)
local TEMPLATE_DIR=$NUX_ENV_DIR/templates
@ -37,9 +37,14 @@ nux.use nuxfs
GIT_BIN=$(which git)
## check Verifies that directories and files matches the specification
## in *.nuxfs* definition
##
## Available commands:
## check:: [<subtree>]
## Verifies that directories and files matches the specification
## in *.nuxfs* definition
###
### Check is non-descructive operation, whose only output is printing out
### information
task.check() {
nuxfs.dsl.process "$@";
}
@ -48,22 +53,25 @@ task.describe() {
nuxfs.dsl.process "$@";
}
## apply Creates missing files as specified in *.nuxfs* definition.
## **DOES NOT MODIFY** existing files breaking specification.
## apply:: [<subtree>]
## Creates missing files as specified in *.nuxfs* definition.
## **DOES NOT MODIFY** existing files breaking specification.
##
task.apply() {
nuxfs.dsl.process "$@";
}
## fix Performs apply and tries to fix warnings and errors and files as
## specified in nuxfs definition. This operation **DOES MODIFY**
## existing files.
## fix:: [<subtree>]
## Performs apply and tries to fix warnings and errors and files as
## specified in nuxfs definition. This operation **DOES MODIFY**
## existing files.
##
task.fix() {
nuxfs.dsl.process "$@";
}
## help.dsl Displays help for **nuxfs DSL language**
## help dsl::
## Displays help for **nuxfs DSL language**
##
task.help.dsl() {
nux.help.comment "$NUX_INC_DIR/dsl/nuxfs.dsl"