update help commands

This commit is contained in:
daveberrys committed 2026-07-21 20:03:36 +08:00
1 parent a74f1e38cc
commit c70919abec
4 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ import (
func init() { cmd.RootCmd.AddCommand(cloneCmd) } func init() { cmd.RootCmd.AddCommand(cloneCmd) }
var cloneCmd = &cobra.Command{ var cloneCmd = &cobra.Command{
Use: "clone", Use: "clone [repository_url]",
Short: "Clone a repository", Short: "Clone a repository",
Args: cobra.MinimumNArgs(1), Args: cobra.MinimumNArgs(1),
RunE: func(cobraCmd *cobra.Command, args []string) error { RunE: func(cobraCmd *cobra.Command, args []string) error {
+5 -5
View File
@@ -13,7 +13,7 @@ import (
func init() { cmd.RootCmd.AddCommand(commitCmd) } func init() { cmd.RootCmd.AddCommand(commitCmd) }
var commitCmd = &cobra.Command{ var commitCmd = &cobra.Command{
Use: "commit [files] [message] [description]", Use: "commit [files] [message] [description:opt]/push:opt [push:opt] [remote_name:opt]",
Short: "Add specified files and commit", Short: "Add specified files and commit",
Args: cobra.RangeArgs(0, 5), Args: cobra.RangeArgs(0, 5),
RunE: func(cobraCmd *cobra.Command, args []string) error { RunE: func(cobraCmd *cobra.Command, args []string) error {
@@ -47,10 +47,10 @@ var commitCmd = &cobra.Command{
commitArgs := []string{"commit", "-m", args[1]} commitArgs := []string{"commit", "-m", args[1]}
afterPush, remoteName := false, "origin" afterPush, remoteName := false, "origin"
// case 1 -> guh commit [files] [message] [desc] push[:optional] [remote_name:optional(origin)] // case 1 -> guh commit [files] [message] [desc] push[:opt] [remote_name:opt(origin)]
// case 2 -> guh commit [files] [message] [desc] push[:optional] // case 2 -> guh commit [files] [message] [desc] push[:opt]
// case 3 -> guh commit [files] [message] push[:optional] [remote_name:optional(origin)] // case 3 -> guh commit [files] [message] push[:opt] [remote_name:opt(origin)]
// case 4 -> guh commit [files] [message] push[:optional] // case 4 -> guh commit [files] [message] push[:opt]
// case 5 -> guh commit [files] [message] [desc] // case 5 -> guh commit [files] [message] [desc]
// case 6 -> guh commit [files] [message] // case 6 -> guh commit [files] [message]
switch len(args) { switch len(args) {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
func init() { cmd.RootCmd.AddCommand(diffCmd) } func init() { cmd.RootCmd.AddCommand(diffCmd) }
var diffCmd = &cobra.Command{ var diffCmd = &cobra.Command{
Use: "diff [file:optional]", Use: "diff [file:opt]",
Short: "Show working tree changes", Short: "Show working tree changes",
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: func(cobraCmd *cobra.Command, args []string) error { RunE: func(cobraCmd *cobra.Command, args []string) error {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
func init() { cmd.RootCmd.AddCommand(pushCmd) } func init() { cmd.RootCmd.AddCommand(pushCmd) }
var pushCmd = &cobra.Command{ var pushCmd = &cobra.Command{
Use: "push [remote]", Use: "push [remote:opt]",
Short: "Add current changes and push", Short: "Add current changes and push",
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: func(cobraCmd *cobra.Command, args []string) error { RunE: func(cobraCmd *cobra.Command, args []string) error {