summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go80
1 files changed, 5 insertions, 75 deletions
diff --git a/main.go b/main.go
index 1731828..c8d5e80 100644
--- a/main.go
+++ b/main.go
@@ -9,7 +9,6 @@ import (
"unicode"
"go.wit.com/lib/protobuf/argvpb"
- "go.wit.com/lib/protobuf/filepb"
"go.wit.com/log"
)
@@ -35,84 +34,15 @@ func main() {
var s string
var err error
- if argv.Upgrade != nil {
- doUpgrade()
- me.argv.GoodExit("")
- }
-
- if argv.Linux != nil {
- if argv.Linux.Rdate != nil {
- s, err = doRdate()
- } else {
- setTerminalTitle("pinging google", "ping", []string{"google.com"})
- }
- }
-
- if argv.Build != nil {
- s, err = doBuild()
- }
-
- if argv.Git != nil {
- initMachine()
- s, err = doGit()
- }
-
- if argv.PB != nil {
- pbuuid, pbver, pberr := filepb.IdentifyPB(argv.PB.Identify)
- if pberr == nil {
- log.Info("pb version is:", pbver)
- log.Info("pb uuid is:", pbuuid)
- s = "pb identify worked"
- } else {
- s = "identify failed"
- err = pberr
- }
- }
-
- if argv.Clone != nil {
- doClone()
- me.argv.GoodExit("")
- }
-
- if argv.WITCOM {
- doWITCOM()
- me.argv.GoodExit("")
- }
-
- if argv.Clone != nil {
- doClone()
- me.argv.GoodExit("")
- }
-
- if argv.WITCOM {
- doWITCOM()
- me.argv.GoodExit("")
- }
-
- if argv.Upgrade != nil {
- doUpgrade()
- }
+ // process the argv subcommand (subCommand.go)
+ s, err = subCommand()
- if argv.Droplet != nil {
- s, err = doDroplet()
- }
-
- if argv.Publish != nil {
- if err := doPublish(); err != nil {
- me.argv.BadExit("doPublish failed", err)
- }
- me.argv.GoodExit("")
- }
-
- if argv.Zoo != nil {
- if areSuperuser() {
- exitOnErrorRealtime([]string{"journalctl", "-n", "100", "-f", "_SYSTEMD_UNIT=zood.service"})
- }
- me.argv.GoodExit("do something here")
- }
+ // argv provides timing and other features on exit
if err != nil {
+ // bad exit back to the shell via argv
me.argv.BadExit(s, err)
}
+ // a good exit back to the shell via argv
me.argv.GoodExit(s)
}