diff --git a/le b/le index 26ff0c6..a33486a 100755 --- a/le +++ b/le @@ -2,4 +2,4 @@ subcommand=$1; shift -source "sub/$subcommand" "$@" +"sub/$subcommand" "$@" diff --git a/lib/util b/lib/util new file mode 100644 index 0000000..c04c25b --- /dev/null +++ b/lib/util @@ -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 +} diff --git a/sub/issue b/sub/issue index e1ff8e5..91574fb 100755 --- a/sub/issue +++ b/sub/issue @@ -1,20 +1,6 @@ #!/usr/bin/env bash -err() { - printf '%s\n' "$*" >&2 -} - -msg() { - printf '%s\n' "$*" -} - -set_default() { - declare -n _vref=$1 - - if ! [[ "$_vref" ]]; then - _vref=$2 - fi -} +source lib/util gen_san_string() { declare d diff --git a/sub/renew b/sub/renew index 8ccf9b5..561f2a8 100755 --- a/sub/renew +++ b/sub/renew @@ -1,20 +1,6 @@ #!/usr/bin/env bash -err() { - printf '%s\n' "$*" >&2 -} - -msg() { - printf '%s\n' "$*" -} - -set_default() { - declare -n _vref=$1 - - if ! [[ "$_vref" ]]; then - _vref=$2 - fi -} +source lib/util usage() { while read -r line; do printf '%s\n' "$line"; done <<- EOF