restructure

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2018-08-31 05:42:43 +03:00
parent 495175cd96
commit 5bdc873d47
4 changed files with 20 additions and 31 deletions

2
le
View File

@ -2,4 +2,4 @@
subcommand=$1; shift subcommand=$1; shift
source "sub/$subcommand" "$@" "sub/$subcommand" "$@"

17
lib/util Normal file
View File

@ -0,0 +1,17 @@
#!syntax bash
err() {
printf '%s\n' "$*" >&2
}
msg() {
printf '%s\n' "$*"
}
set_default() {
declare -n _vref=$1
if ! [[ "$_vref" ]]; then
_vref=$2
fi
}

View File

@ -1,20 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
err() { source lib/util
printf '%s\n' "$*" >&2
}
msg() {
printf '%s\n' "$*"
}
set_default() {
declare -n _vref=$1
if ! [[ "$_vref" ]]; then
_vref=$2
fi
}
gen_san_string() { gen_san_string() {
declare d declare d

View File

@ -1,20 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
err() { source lib/util
printf '%s\n' "$*" >&2
}
msg() {
printf '%s\n' "$*"
}
set_default() {
declare -n _vref=$1
if ! [[ "$_vref" ]]; then
_vref=$2
fi
}
usage() { usage() {
while read -r line; do printf '%s\n' "$line"; done <<- EOF while read -r line; do printf '%s\n' "$line"; done <<- EOF