Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 6419cc14 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Update help and show commands

parent c2478c6a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -49,8 +49,8 @@ require() {
for CMD in $*; do
local __cmd=`which $1`
[ $? -ne 0 ] && die "Failed to find the '$1' command"
alias $1=$__cmd
REQUIREMENTS="$1 $REQUIREMENTS"
alias $CMD=$__cmd
REQUIREMENTS="$CMD $REQUIREMENTS"
done
}
require \
......@@ -95,15 +95,15 @@ usage() {
echo `__bold "$BASE_NAME usage:"`
BASE_NAME=`__green "$BASE_NAME"`
cat << EOF
$BASE_NAME -install `__yellow "[-sshfs 'username@server' -local mnt_point] [install_path]"`
$BASE_NAME -install [`__yellow "-sshfs 'username@server' -local mnt_point"`] [`__yellow "install_path"`]
$BASE_NAME show
$BASE_NAME help
$BASE_NAME update
$BASE_NAME list `__yellow "[-p -e -np] [bash_regex]"`
$BASE_NAME add|del `__yellow "<pack>"`
$BASE_NAME pack `__yellow "[-t token] [name] <pack_folder>"`
$BASE_NAME display `__yellow "[-dl folder] <pack_name> [sticker_regex]"`
$BASE_NAME edit `__yellow "<pack_name>"` add|del `__yellow "<sticker> [file]"`
$BASE_NAME list [`__yellow "-p -e -np"`] [`__yellow "bash_regex"`]
$BASE_NAME add|del <`__yellow "pack"`>
$BASE_NAME pack [`__yellow "-t token"`] [`__yellow "name"`] <`__yellow "pack_folder"`>
$BASE_NAME display [`__yellow "-dl folder"`] <`__yellow "pack_name"`> [`__yellow "sticker_regex"`]
$BASE_NAME edit <`__yellow "pack_name"`> add|del <`__yellow "sticker"`> [`__yellow "file"`]
`__bold Flags:`
`__yellow "-e"` / `__yellow "-ne"` The pack is enabled / disabled
......@@ -120,14 +120,14 @@ cat << EOF
`__green STPKG_HOMESERV` [`__italic 'homeserv'`] The Matrix home server. [$(__yellow `__italic 'iiens.net'`)]
`__bold Notes:`
The `__italic "'stpkg -install [path]'"` must be called only once. The default install
path is `__italic "'~/html/stickerpicker'"`. This command will give you a `__italic STPKG_INSTALL`
and a `__italic STPKG_BASE` env that you must put in your bashrc for the rest of the
The `__italic "$(__yellow 'stpkg -install [path]')"` must be called only once. The default install
path is `__italic "$(__yellow '~/html/stickerpicker')"`. This command will give you a `__italic $(__yellow STPKG_INSTALL)`
and a `__italic $(__yellow STPKG_BASE)` env that you must put in your bashrc for the rest of the
stpkg commands to work.
`__bold Requirements:`
The stpkg command requires 'egrep'. If 'egrep' is not found, 'grep' will be
used. Here is a list of all the requirements:
The stpkg command requires `__italic $(__yellow 'egrep')`. If `__italic $(__yellow 'egrep')` is not found, `__italic $(__yellow 'grep')` will be
used instead. Here is a list of all the requirements:
$REQUIREMENTS
EOF
exit 0
......@@ -334,7 +334,7 @@ __show() {
if [ "x$STPKG_SSHFS" = "xyes" ]; then
cat << EOF
`__bold stpkg with sshfs install:`
sshfs target is mounted: `[ -d $STPKG_INSTALL ] && __green 'yes' || __yellow 'no'`
sshfs `[ -d $STPKG_INSTALL ] && __green 'mounted' || __yellow 'umounted'`
EOF
fi
......@@ -358,7 +358,13 @@ cat << EOF
`__green STPKG_NO_MSG` `__italic $($COLOR_STNOMSG $STPKG_NO_MSG)`
`__green STPKG_HOMESERV` `__italic $STPKG_HOMESERV`
`__green STPKG_TOKEN` $TOKEN
`__bold aliased commands due to the '"require"' function:`
EOF
for CMD in $REQUIREMENTS; do
echo -e " `__green $CMD` `which $CMD`"
done | sort | column -t | while IFS= read LINE; do
echo " $LINE"
done
}
__update() {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter