"true" and "false" commands are implemented.
This commit is contained in:
parent
023cea5bbe
commit
f1fd751b48
3 changed files with 15 additions and 1 deletions
5
gfalse/false.go
Normal file
5
gfalse/false.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package gfalse
|
||||||
|
|
||||||
|
func Run(args []string) int {
|
||||||
|
return 1
|
||||||
|
}
|
5
gtrue/true.go
Normal file
5
gtrue/true.go
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package gtrue
|
||||||
|
|
||||||
|
func Run(args []string) int {
|
||||||
|
return 0
|
||||||
|
}
|
4
main.go
4
main.go
|
@ -7,6 +7,8 @@ import(
|
||||||
"github.com/jienfak/goblin/cat"
|
"github.com/jienfak/goblin/cat"
|
||||||
"github.com/jienfak/goblin/echo"
|
"github.com/jienfak/goblin/echo"
|
||||||
"github.com/jienfak/goblin/mkdir"
|
"github.com/jienfak/goblin/mkdir"
|
||||||
|
"github.com/jienfak/goblin/gtrue"
|
||||||
|
"github.com/jienfak/goblin/gfalse"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -20,6 +22,8 @@ func main() {
|
||||||
"cat": cat.Run,
|
"cat": cat.Run,
|
||||||
"mkdir" : mkdir.Run,
|
"mkdir" : mkdir.Run,
|
||||||
"echo" : echo.Run,
|
"echo" : echo.Run,
|
||||||
|
"true" : gtrue.Run,
|
||||||
|
"false" : gfalse.Run,
|
||||||
}
|
}
|
||||||
|
|
||||||
if binBase := path.Base(os.Args[0]) ; binBase != "goblin" {
|
if binBase := path.Base(os.Args[0]) ; binBase != "goblin" {
|
||||||
|
|
Loading…
Reference in a new issue