summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2020-01-14 15:26:33 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-01-15 17:29:04 +0100
commita423f0e46c0692f872dff297dff89fbe531f74fd (patch)
tree0d7a0a3e6cb0ffccd94d6e79b374cbf476947b7f
parente6b8b91dcd38ebcfbb0d41753d814edf78b06989 (diff)
downloadsocklog-void-a423f0e46c0692f872dff297dff89fbe531f74fd.tar.gz
socklog-void-a423f0e46c0692f872dff297dff89fbe531f74fd.tar.xz
socklog-void-a423f0e46c0692f872dff297dff89fbe531f74fd.zip
Add usage help to svlogtail
-rwxr-xr-xsvlogtail16
1 files changed, 12 insertions, 4 deletions
diff --git a/svlogtail b/svlogtail
index 4daa2f9..4e91149 100755
--- a/svlogtail
+++ b/svlogtail
@@ -1,8 +1,13 @@
 #!/bin/sh
-# svlogtail [LOGS...] - show svlogd logs conveniently
-#
-# Without arguments, show current logs of all services, uniquely.
-# With arguments, show all logs of mentioned services.
+
+usage () {
+	cat <<-'EOF'
+	svlogtail [LOG...] - show svlogd logs conveniently
+
+	Without arguments, show current logs of all services, uniquely.
+	With arguments, show all logs of mentioned services
+	EOF
+}
 
 if [ $# = 0 ]; then
 	cat /var/log/socklog/*/current | sort -u
@@ -11,6 +16,9 @@ else
 	old=
 	cur=
 	for log; do
+		case "$log" in
+			-*) usage; exit 1;;
+		esac
 		if [ -d /var/log/socklog/$log ]; then
 			old="$old /var/log/socklog/$log/*.[us]"
 			cur="$cur /var/log/socklog/$log/current"