Beispiel #1
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagForce, "force", flagForce, "force repo init process")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #2
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagAskOnce, "ask_once", flagAskOnce,
		"ask once and reuse the story ID for all commits")
	Command.Flags.UintVar(&flagFixes, "fixes", flagFixes,
		"mark the commits as fixing issues in the given review request")
	Command.Flags.BoolVar(&flagMergeNoFF, "merge_no_ff", flagMergeNoFF,
		"run git merge with --no-ff flag")
	Command.Flags.BoolVar(&flagNoFetch, "no_fetch", flagNoFetch,
		"do not fetch the upstream repository")
	Command.Flags.BoolVar(&flagNoMerge, "no_merge", flagNoMerge,
		"do not merge the current branch into the parent branch")
	Command.Flags.BoolVar(&flagNoRebase, "no_rebase", flagNoRebase,
		"do not rebase onto the parent branch")
	Command.Flags.BoolVar(&flagOpen, "open", flagOpen,
		"open the review requests in the browser")
	Command.Flags.StringVar(&flagParent, "parent", flagParent,
		"branch to be used in computing the revision range")
	Command.Flags.BoolVar(&flagPick, "pick", flagPick,
		"pick only some of the selected commits for review")
	Command.Flags.StringVar(&flagReviewer, "reviewer", flagReviewer,
		"reviewer to assign to the newly created review requests")
	Command.Flags.StringVar(&flagStoryIdTag, "story_tag", flagStoryIdTag,
		"Story-Id tag to use when posting commit missing the tag")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #3
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&porcelain, "porcelain", false, "enable script-friendly output")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #4
0
func init() {
	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)

	// Register subcommands.
	Command.MustRegisterSubcommand(bumpCmd.Command)
}
Beispiel #5
0
func init() {
	// Register flags.
	Command.Flags.Var(flagFormat, "format", "output format")
	Command.Flags.BoolVar(&flagPretty, "pretty", flagPretty, "pretty-print the output")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #6
0
func init() {
	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)

	// Register subcommands.
	Command.MustRegisterSubcommand(installCmd.Command)
	Command.MustRegisterSubcommand(upgradeCmd.Command)
}
Beispiel #7
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagNoFetch, "no_fetch", flagNoFetch,
		"do not fetch the remote repository")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #8
0
func init() {
	// Register flags.
	Command.Flags.StringVar(&flagOwner, "github_owner", flagOwner, "GitHub account name")
	Command.Flags.StringVar(&flagRepo, "github_repo", flagRepo, "GitHub repository name")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #9
0
func init() {
	// Register flags.
	Command.Flags.Var(&flagNextTrunk, "next_trunk_version", "the next trunk version string")
	Command.Flags.BoolVar(&flagNoFetch, "no_fetch", flagNoFetch, "do not fetch the remote")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #10
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagCommit, "commit", flagCommit,
		"commit the new version string")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #11
0
func init() {
	// Register flags.
	Command.Flags.StringVar(&flagDst, "dst", flagDst, "directory to place the executables into")
	Command.Flags.StringVar(&flagOwner, "github_owner", flagOwner, "GitHub account name")
	Command.Flags.StringVar(&flagRepo, "github_repo", flagRepo, "GitHub repository name")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #12
0
func init() {
	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)

	// Register subcommands.
	Command.MustRegisterSubcommand(bootstrapCmd.Command)
	Command.MustRegisterSubcommand(initCmd.Command)
	Command.MustRegisterSubcommand(pruneCmd.Command)
}
Beispiel #13
0
func init() {
	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)

	// Register subcommands.
	Command.MustRegisterSubcommand(changesCmd.Command)
	Command.MustRegisterSubcommand(openCmd.Command)
	Command.MustRegisterSubcommand(startCmd.Command)
}
Beispiel #14
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagFetch, "fetch", flagFetch,
		"update the project remote before proceeding futher")
	Command.Flags.StringVar(&flagTarget, "target", flagTarget,
		"the branch to cherry-pick commits into")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #15
0
func init() {
	// Register flags.
	Command.Flags.StringVar(&flagBase, "base", flagBase,
		"the branch to base the story branch on")
	Command.Flags.BoolVar(&flagNoBranch, "no_branch", flagNoBranch,
		"do not create a new story branch")
	Command.Flags.BoolVar(&flagPush, "push", flagPush,
		"push the newly created story branch")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #16
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagNoSkeleton, "no_skeleton", flagNoSkeleton,
		"do not use any skeleton to bootstrap the repository")
	Command.Flags.StringVar(&flagSkeleton, "skeleton", flagSkeleton,
		"skeleton to be used to bootstrap the repository")
	Command.Flags.BoolVar(&flagSkeletonOnly, "skeleton_only", flagSkeletonOnly,
		"skip the config dialog and only install the skeleton")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #17
0
func init() {
	// Register flags.
	Command.Flags.BoolVar(&flagPorcelain, "porcelain", flagPorcelain,
		"enable script-friendly output")
	Command.Flags.BoolVar(&flagToCherryPick, "to_cherrypick", flagToCherryPick,
		"list the changes to cherry-pick")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)

	// Register the subcommands.
	Command.MustRegisterSubcommand(cherrypickCmd.Command)
}
Beispiel #18
0
func init() {
	states := make([]string, 0, len(stateEnum))
	for _, state := range stateEnum {
		states = append(states, string(state))
	}

	// Finalize Command.
	Command.UsageLine = fmt.Sprintf("prune [-state={%v}]", strings.Join(states, "|"))

	// Register flags.
	flagState = flag.NewStringEnumFlag(states, string(common.StoryStateAccepted))
	Command.Flags.Var(flagState, "state", "set the required story state for branch removal")

	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}
Beispiel #19
0
func main() {
	// Initialise the application.
	trunk := gocli.NewApp("salsaflow")
	trunk.UsageLine = "salsaflow SUBCMD [SUBCMD_OPTION ...]"
	trunk.Short = "the ultimate Trunk Based Development CLI utility"
	trunk.Version = metadata.Version
	trunk.Long = `
  salsaflow is a CLI utility that provides some useful shortcuts for
  Trunk Based Development. See the list of subcommands.`

	// Set up the top-level action function.
	var flagVersion bool
	trunk.Flags.BoolVar(&flagVersion, "version", flagVersion, "print SalsaFlow version and exit")
	trunk.Action = func(cmd *gocli.Command, args []string) {
		if len(args) != 0 || !flagVersion {
			cmd.Usage()
			os.Exit(2)
		}
		fmt.Println(metadata.Version)
	}

	// Register global flags.
	appflags.RegisterGlobalFlags(&trunk.Flags)

	// Register subcommands.
	trunk.MustRegisterSubcommand(cherrypickCmd.Command)
	trunk.MustRegisterSubcommand(pkgCmd.Command)
	trunk.MustRegisterSubcommand(releaseCmd.Command)
	trunk.MustRegisterSubcommand(repoCmd.Command)
	trunk.MustRegisterSubcommand(reviewCmd.Command)
	trunk.MustRegisterSubcommand(storyCmd.Command)
	trunk.MustRegisterSubcommand(versionCmd.Command)

	// Start processing signals.
	signalCh := make(chan os.Signal, 1)
	signal.Notify(signalCh, os.Interrupt)
	go catchSignals(signalCh)

	// Run the application.
	trunk.Run(os.Args[1:])
}
Beispiel #20
0
func init() {
	// Register global flags.
	appflags.RegisterGlobalFlags(&Command.Flags)
}