Skip to content

Instantly share code, notes, and snippets.

@selfup
Created August 12, 2019 17:38
Show Gist options
  • Save selfup/c5a7ad09378d30581048f6462b9cb910 to your computer and use it in GitHub Desktop.
Save selfup/c5a7ad09378d30581048f6462b9cb910 to your computer and use it in GitHub Desktop.
package main
import (
"flag"
"strings"
"github.com/selfup/gosh"
)
func main() {
var cmd string
flag.StringVar(&cmd, "cmd", "", "REQUIRED TO RUN ANYTHING")
var args string
flag.StringVar(&args, "args", "", "REQUIRED TO RUN ANYTHING")
flag.Parse()
if cmd == "" {
panic("please pass a cmd")
}
if args == "" {
panic("please pass args to cmd")
}
splitArgs := strings.Split(args, " ")
switch cmd {
case "mv":
err := gosh.Mv(splitArgs[0], splitArgs[1])
if err != nil {
panic(err)
}
break
default:
panic("wadu hek")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment