summaryrefslogtreecommitdiff
path: root/scripts/cli/noc
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-11-25 18:47:27 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-11-25 18:47:27 +0400
commitd947956270b092df10637bb3531441caca698b86 (patch)
tree8c32170ef044687b11be79398140a36430e2ff0a /scripts/cli/noc
parentc388ade6b6d955138698731af02dfbe5c676439a (diff)
feat: new api for scripts
Diffstat (limited to 'scripts/cli/noc')
-rwxr-xr-xscripts/cli/noc15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/cli/noc b/scripts/cli/noc
index 575566c..63bee86 100755
--- a/scripts/cli/noc
+++ b/scripts/cli/noc
@@ -1,6 +1,19 @@
#!/bin/sh
-# Remove empty lines and all the comments starting with "#"
+. "lib_common.sh"
+
+help() {
+cat << EOF
+${0}: Remove empty lines and all the comments starting with '#'.
+options:
+ -h Print this message and exit
+EOF
+exit 0
+}
+
+[ "${1}" = "-h" ] && help
+
+[ ${#} -gt 0 ] && invalid_use
for file in "${@}"; do
sed -i "s/\s*#.*//g; /^$/ d" "${file}"