From 09c75f1236f996103e2fe35da04d156a886b2240 Mon Sep 17 00:00:00 2001 From: shoce Date: Sun, 6 Oct 2024 19:23:58 +0530 Subject: [PATCH] args --- hs.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hs.go b/hs.go index 40433ab..6f430d4 100644 --- a/hs.go +++ b/hs.go @@ -721,11 +721,12 @@ func hs() { inreader := bufio.NewReaderSize(os.Stdin, InReaderBufferSize) - if len(args) > 0 { - if args[0] != "--" { - log("the first argument should be `--`, example `hs -- id`") - os.Exit(1) - } + if len(args) > 0 && args[0] != "--" { + log("the first argument should be `--`, example `hs -- id`") + os.Exit(1) + } + + if len(args) > 1 { cmd := args[1:] cmds := strings.Join(cmd, " ")