Merge pull request #123 from github/flags-language
Tweak flags language
This commit is contained in:
commit
8955d3e70e
3 changed files with 14 additions and 15 deletions
|
|
@ -21,17 +21,17 @@ func init() {
|
|||
"Supply a title. Will prompt for one otherwise.")
|
||||
issueCreateCmd.Flags().StringP("body", "b", "",
|
||||
"Supply a body. Will prompt for one otherwise.")
|
||||
issueCreateCmd.Flags().BoolP("web", "w", false, "open the web browser to create an issue")
|
||||
issueCreateCmd.Flags().BoolP("web", "w", false, "Open the web browser to create an issue")
|
||||
|
||||
issueListCmd := &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List and filter issues in this repository",
|
||||
RunE: issueList,
|
||||
}
|
||||
issueListCmd.Flags().StringP("assignee", "a", "", "filter by assignee")
|
||||
issueListCmd.Flags().StringSliceP("label", "l", nil, "filter by label")
|
||||
issueListCmd.Flags().StringP("state", "s", "", "filter by state (open|closed|all)")
|
||||
issueListCmd.Flags().IntP("limit", "L", 30, "maximum number of issues to fetch")
|
||||
issueListCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
|
||||
issueListCmd.Flags().StringSliceP("label", "l", nil, "Filter by label")
|
||||
issueListCmd.Flags().StringP("state", "s", "", "Filter by state (open|closed|all)")
|
||||
issueListCmd.Flags().IntP("limit", "L", 30, "Maximum number of issues to fetch")
|
||||
issueCmd.AddCommand((issueListCmd))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ func init() {
|
|||
prCmd.AddCommand(prStatusCmd)
|
||||
prCmd.AddCommand(prViewCmd)
|
||||
|
||||
prListCmd.Flags().IntP("limit", "L", 30, "maximum number of items to fetch")
|
||||
prListCmd.Flags().StringP("state", "s", "open", "filter by state")
|
||||
prListCmd.Flags().StringP("base", "b", "", "filter by base branch")
|
||||
prListCmd.Flags().StringArrayP("label", "l", nil, "filter by label")
|
||||
prListCmd.Flags().IntP("limit", "L", 30, "Maximum number of items to fetch")
|
||||
prListCmd.Flags().StringP("state", "s", "open", "Filter by state")
|
||||
prListCmd.Flags().StringP("base", "B", "", "Filter by base branch")
|
||||
prListCmd.Flags().StringArrayP("label", "l", nil, "Filter by label")
|
||||
}
|
||||
|
||||
var prCmd = &cobra.Command{
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@ var BuildDate = "YYYY-MM-DD"
|
|||
|
||||
func init() {
|
||||
RootCmd.Version = fmt.Sprintf("%s (%s)", strings.TrimPrefix(Version, "v"), BuildDate)
|
||||
RootCmd.AddCommand(versionCmd)
|
||||
RootCmd.AddCommand(versionCmd)
|
||||
|
||||
RootCmd.PersistentFlags().StringP("repo", "R", "", "current GitHub repository")
|
||||
RootCmd.PersistentFlags().StringP("current-branch", "B", "", "current git branch")
|
||||
RootCmd.PersistentFlags().StringP("repo", "R", "", "Current GitHub repository")
|
||||
RootCmd.PersistentFlags().Bool("help", false, "Show help for command")
|
||||
RootCmd.Flags().Bool("version", false, "Print gh version")
|
||||
// TODO:
|
||||
// RootCmd.PersistentFlags().BoolP("verbose", "V", false, "enable verbose output")
|
||||
|
||||
|
|
@ -67,9 +68,7 @@ func contextForCommand(cmd *cobra.Command) context.Context {
|
|||
ctx := initContext()
|
||||
if repo, err := cmd.Flags().GetString("repo"); err == nil && repo != "" {
|
||||
ctx.SetBaseRepo(repo)
|
||||
}
|
||||
if branch, err := cmd.Flags().GetString("current-branch"); err == nil && branch != "" {
|
||||
ctx.SetBranch(branch)
|
||||
ctx.SetBranch("master")
|
||||
}
|
||||
return ctx
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue