summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-08 22:45:51 -0500
committerJeff Carr <[email protected]>2025-09-08 22:45:51 -0500
commit297355f27eec391451864c65dde39404b59b5a92 (patch)
tree70e474c0cce333ed1feaf4abf05b8196b55873f8 /main.go
parente62d74f0e6d8249d7637fcff81328f3b6e422cbc (diff)
minor code reorder
Diffstat (limited to 'main.go')
-rw-r--r--main.go26
1 files changed, 12 insertions, 14 deletions
diff --git a/main.go b/main.go
index 1d68ae8..2b33665 100644
--- a/main.go
+++ b/main.go
@@ -140,6 +140,16 @@ func main() {
okExit("")
}
+ if argv.Help != nil {
+ doHelp()
+ okExit("")
+ }
+
+ if argv.Dirty != nil {
+ doDirty()
+ okExit("")
+ }
+
if argv.Normal != nil {
if argv.Normal.On != nil {
if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL {
@@ -151,6 +161,7 @@ func main() {
log.Info("normal mode on")
okExit("")
}
+
if argv.Normal.Off != nil {
if me.forge.Config.Mode != forgepb.ForgeMode_NORMAL {
log.Info("you were aleady not in the normal state")
@@ -174,6 +185,7 @@ func main() {
okExit("")
}
+
// if you are in "normal" mode, always run normal every time to catch accidental errors
// for example, if you accidentally changed branches from your user branch
if me.forge.Config.Mode == forgepb.ForgeMode_NORMAL {
@@ -182,10 +194,6 @@ func main() {
}
}
- if argv.Dirty != nil {
- doDirty()
- okExit("")
- }
if argv.Merge != nil {
if argv.Merge.Devel != nil {
@@ -235,16 +243,6 @@ func main() {
okExit("")
}
- if argv.Help != nil {
- doHelp()
- okExit("")
- }
-
- // todo: redo this logic using forgepb
- if configSave {
- me.forge.ConfigSave()
- configSave = false
- }
// if the user doesn't want to open the GUI and
// nothing else was specified to be done,