Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add version variable and tie update to only outdated version #47

Merged
merged 4 commits into from
Dec 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into feat_add_update_command
  • Loading branch information
Slug-Boi authored Nov 29, 2024
commit 22db51ab118b0dc3a2fea9a2d63e7010a69a0c16
10 changes: 9 additions & 1 deletion src/cmd/root.go
Original file line number Diff line number Diff line change
@@ -38,10 +38,17 @@ var rootCmd = &cobra.Command{
tflag, _ := cmd.Flags().GetBool("test_print")
aflag, _ := cmd.Flags().GetBool("authors")
vflag, _ := cmd.Flags().GetBool("version")

gflag, _ := cmd.Flags().GetString("git")

if vflag {
fmt.Println("Cocommit version:", Coco_Version)
os.Exit(0)
}

var git_flags []string
// runs the git commit command
if gflag != "" {
git_flags = strings.Split(gflag, " ")
}

if aflag {
@@ -124,4 +131,5 @@ func init() {
rootCmd.Flags().BoolP("message", "m", false, "Does nothing but allows for -m to be used in the command")
rootCmd.Flags().BoolP("authors", "a", false, "Runs the author list TUI")
rootCmd.Flags().BoolP("version", "v", false, "Prints the version of the cocommit cli tool")
rootCmd.Flags().StringP("git", "g", "", "Adds the given flags to the git command")
}
You are viewing a condensed version of this merge commit. You can view the full changes here.