aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-01-06 20:11:05 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-01-06 20:11:05 +0300
commit47c8a75f97f21ae6cffa61e61e62000642f82ab7 (patch)
tree131e96ec73828e5b9773248faea8858ae1aec7cf /src
parentdb.sh: consistent logging (diff)
downloadconfig-links-47c8a75f97f21ae6cffa61e61e62000642f82ab7.tar.gz
config-links-47c8a75f97f21ae6cffa61e61e62000642f82ab7.zip
db.sh: add parse_mode function
Diffstat (limited to 'src')
-rw-r--r--src/db.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/db.sh b/src/db.sh
index d987e85..b057202 100644
--- a/src/db.sh
+++ b/src/db.sh
@@ -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