From f1fd751b4845b2342fbf301540435668d9417385 Mon Sep 17 00:00:00 2001 From: jienfak Date: Fri, 8 Nov 2019 04:00:23 +0500 Subject: [PATCH] "true" and "false" commands are implemented. --- gfalse/false.go | 5 +++++ gtrue/true.go | 5 +++++ main.go | 6 +++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 gfalse/false.go create mode 100644 gtrue/true.go diff --git a/gfalse/false.go b/gfalse/false.go new file mode 100644 index 0000000..043fe8a --- /dev/null +++ b/gfalse/false.go @@ -0,0 +1,5 @@ +package gfalse + +func Run(args []string) int { + return 1 +} \ No newline at end of file diff --git a/gtrue/true.go b/gtrue/true.go new file mode 100644 index 0000000..56a5308 --- /dev/null +++ b/gtrue/true.go @@ -0,0 +1,5 @@ +package gtrue + +func Run(args []string) int { + return 0 +} \ No newline at end of file diff --git a/main.go b/main.go index fab233d..c380f3e 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,8 @@ import( "github.com/jienfak/goblin/cat" "github.com/jienfak/goblin/echo" "github.com/jienfak/goblin/mkdir" + "github.com/jienfak/goblin/gtrue" + "github.com/jienfak/goblin/gfalse" ) func main() { @@ -20,6 +22,8 @@ func main() { "cat": cat.Run, "mkdir" : mkdir.Run, "echo" : echo.Run, + "true" : gtrue.Run, + "false" : gfalse.Run, } if binBase := path.Base(os.Args[0]) ; binBase != "goblin" { @@ -42,4 +46,4 @@ func main() { } status := utilsMap[utilName].(func([]string) int )(args) os.Exit(status) -} \ No newline at end of file +}