From 7d07dc91f95d94303922150270734e182f87d27a Mon Sep 17 00:00:00 2001 From: AnisB Date: Fri, 13 Aug 2021 21:33:57 +0100 Subject: [PATCH] help of help edit Former-commit-id: a80a60a334667102f3e4e3a55389eff39e774183 --- main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 056ad19..e9b14e6 100644 --- a/main.go +++ b/main.go @@ -108,11 +108,19 @@ type HelloCmd struct { } func (*HelloCmd) Run(args []string) (string, error) { - for _, result := range args { + /*for _, result := range args { if result == "help" { return "help of hello", nil } + }*/ + + if len(args) != 0 && args[0] == "help" { + fmt.Println("Inside 1") + return "help of hello", nil + } else if len(args) != 0 && args[0] != "help" { + return "unkown command", nil } + return "Hi, My name is Skynet 1.0. \n How can I help you ? ", nil }