diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-06 20:11:05 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-01-06 20:11:05 +0300 |
commit | 47c8a75f97f21ae6cffa61e61e62000642f82ab7 (patch) | |
tree | 131e96ec73828e5b9773248faea8858ae1aec7cf /src | |
parent | db.sh: consistent logging (diff) | |
download | config-links-47c8a75f97f21ae6cffa61e61e62000642f82ab7.tar.gz config-links-47c8a75f97f21ae6cffa61e61e62000642f82ab7.zip |
db.sh: add parse_mode function
Diffstat (limited to 'src')
-rw-r--r-- | src/db.sh | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -263,6 +263,23 @@ unlink_obsolete_entries() { done } +parse_mode() { + if [ "$#" -ne 1 ]; then + echo "usage: ${FUNCNAME[0]} MODE" >&2 + return 1 + fi + + local mode="$1" + shift + + if [ -z "$mode" ]; then + dump "mode cannot be empty" >&2 + return 1 + fi + + echo "$mode" +} + chmod_entries() { if [ "$#" -ne 1 ]; then echo "usage: ${FUNCNAME[0]} MODE" >&2 |