-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var rootCmd = &cobra.Command{ | ||
Use: "gitui", | ||
Short: "blazing fast terminal-ui for git", | ||
Long: "https://github.com/extrawurst/gitui", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func Execute() error { | ||
return rootCmd.Execute() | ||
} | ||
func init() { | ||
carapace.Gen(rootCmd).Standalone() | ||
|
||
rootCmd.Flags().String("bugreport", "", "Generate a bug report") | ||
rootCmd.Flags().StringP("directory", "d", "", "Set the git directory") | ||
rootCmd.Flags().BoolP("help", "h", false, "Print help information") | ||
rootCmd.Flags().BoolP("logging", "l", false, "Stores logging output into a cache directory") | ||
rootCmd.Flags().Bool("polling", false, "Poll folder for changes instead of using file system events") | ||
rootCmd.Flags().StringP("theme", "t", "", "Set the color theme") | ||
rootCmd.Flags().BoolP("version", "V", false, "Print version information") | ||
rootCmd.Flags().StringP("workdir", "w", "", "Set the working directory") | ||
|
||
// TODO theme completion | ||
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{ | ||
"directory": carapace.ActionDirectories(), | ||
"workdir": carapace.ActionDirectories(), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/rsteube/carapace-bin/completers/gitui_completer/cmd" | ||
|
||
func main() { | ||
cmd.Execute() | ||
} |