mirror of
https://github.com/daveberrys/guh.git
synced 2026-11-29 00:46:45 +08:00
diff specific file
This commit is contained in:
1 parent
5c7575a889
commit
49d1efe4c9
1 file changed
+3
-2
+3
-2
@@ -8,10 +8,11 @@ import (
|
|||||||
func init() { rootCmd.AddCommand(diffCmd) }
|
func init() { rootCmd.AddCommand(diffCmd) }
|
||||||
|
|
||||||
var diffCmd = &cobra.Command{
|
var diffCmd = &cobra.Command{
|
||||||
Use: "diff",
|
Use: "diff [file:optional]",
|
||||||
Short: "Show working tree changes",
|
Short: "Show working tree changes",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.MaximumNArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) == 1 { return utils.RunGitSequence(false, []string{"diff", args[0]}) }
|
||||||
return utils.RunGitSequence(false, []string{"diff"})
|
return utils.RunGitSequence(false, []string{"diff"})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user