summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--argv.go1
-rw-r--r--argvAutoshell.go4
-rw-r--r--main.go27
3 files changed, 30 insertions, 2 deletions
diff --git a/argv.go b/argv.go
index 2dfbc42..68c591e 100644
--- a/argv.go
+++ b/argv.go
@@ -15,6 +15,7 @@ import (
var argv args
type args struct {
+ Help *EmptyCmd `arg:"subcommand:help" help:"New to forge? This is for you.'"`
Checkout *CheckoutCmd `arg:"subcommand:checkout" help:"switch branches using 'git checkout'"`
Clean *CleanCmd `arg:"subcommand:clean" help:"start over at the beginning"`
Commit *CommitCmd `arg:"subcommand:commit" help:"'git commit' but errors out if on wrong branch"`
diff --git a/argvAutoshell.go b/argvAutoshell.go
index 899d2e2..42e958e 100644
--- a/argvAutoshell.go
+++ b/argvAutoshell.go
@@ -21,7 +21,7 @@ func deleteMatch() {
}
func (args) doBashAuto() {
- argv.doBashHelp()
+ // argv.doBashHelp()
switch argv.BashAuto[0] {
case "checkout":
fmt.Println("devel master user")
@@ -58,7 +58,7 @@ func (args) doBashAuto() {
default:
if argv.BashAuto[0] == ARGNAME {
// list the subcommands here
- fmt.Println("--bash list checkout clean commit dirty debug fetch normal merge patch pull")
+ fmt.Println("help list checkout clean commit dirty debug fetch normal merge patch pull")
}
}
os.Exit(0)
diff --git a/main.go b/main.go
index c51f185..05f144e 100644
--- a/main.go
+++ b/main.go
@@ -197,6 +197,11 @@ func main() {
okExit("")
}
+ if argv.Help != nil {
+ doHelp()
+ okExit("")
+ }
+
// todo: redo this logic using forgepb
if configSave {
me.forge.ConfigSave()
@@ -220,3 +225,25 @@ func main() {
doGui()
okExit("")
}
+
+// keep this small
+func doHelp() {
+ log.Info("")
+ log.Info("forge -h : to see the available options")
+ log.Info("forge --bash : will create a bash autocomplete file")
+ log.Info("forge : with no arguements, forge tries to load a GO GUI plugin")
+ log.Info(" : there are two GUI plugins. terminal & GTK")
+ log.Info("")
+ log.Info("forge list : shows a table of all your repos")
+ log.Info("forge checkout : checks out all your repos to the same branch")
+ log.Info(" : the default is your user branch")
+ log.Info("forge clean : reverts all repos to the master branch")
+ log.Info("forge dirty : show all repos git reports as dirty")
+ log.Info("")
+ okExit("")
+}
+
+func doHelpPatches() {
+ log.Info("TODO: ?")
+ okExit("")
+}