Created
August 12, 2019 17:38
-
-
Save selfup/c5a7ad09378d30581048f6462b9cb910 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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