From 6592d05448d281495a081595251f1f61d0b81f55 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Tue, 31 Aug 2021 13:11:37 -0700 Subject: [PATCH] allow piping to stackparse without specifying any arguments --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index d697df8..d612a3a 100644 --- a/main.go +++ b/main.go @@ -41,7 +41,7 @@ If your stacks have some prefix to them (like a systemd log prefix) trim it with } func main() { - if len(os.Args) < 2 || os.Args[1] == "-h" || os.Args[1] == "--help" { + if len(os.Args) > 1 && (os.Args[1] == "-h" || os.Args[1] == "--help") { fmt.Printf("usage: %s \n", os.Args[0]) printHelp() return