Skip to content

Commit

Permalink
Merge pull request #629 from bmeneguele/fix-deprecate-flags
Browse files Browse the repository at this point in the history
mr,issue,snippet: make shorthand flags deprecated
  • Loading branch information
bmeneg authored Mar 10, 2021
2 parents f0c60c5 + 8b27899 commit c79e750
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ var issueCmd = &cobra.Command{

func init() {
issueCmd.Flags().BoolP("list", "l", false, "list issues on a remote")
issueCmd.Flags().MarkDeprecated("list", "use the \"list\" subcommand instead")
issueCmd.Flags().BoolP("browse", "b", false, "view issue <id> in a browser")
issueCmd.Flags().MarkDeprecated("browse", "use the \"browse\" subcommand instead")
issueCmd.Flags().StringP("close", "d", "", "close issue <id> on remote")
issueCmd.Flags().MarkDeprecated("close", "use the \"close\" subcommand instead")
RootCmd.AddCommand(issueCmd)
}
3 changes: 3 additions & 0 deletions cmd/mr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ var mrCmd = &cobra.Command{

func init() {
mrCmd.Flags().BoolP("list", "l", false, "list merge requests on a remote")
mrCmd.Flags().MarkDeprecated("list", "use the \"list\" subcommand instead")
mrCmd.Flags().BoolP("browse", "b", false, "view merge request <id> in a browser")
mrCmd.Flags().MarkDeprecated("browse", "use the \"browse\" subcommand instead")
mrCmd.Flags().StringP("close", "d", "", "close merge request <id> on remote")
mrCmd.Flags().MarkDeprecated("close", "use the \"close\" subcommand instead")
RootCmd.AddCommand(mrCmd)
}
3 changes: 3 additions & 0 deletions cmd/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ var (
func init() {
snippetCmd.PersistentFlags().BoolVarP(&global, "global", "g", false, "create as a personal snippet")
snippetCmd.Flags().BoolP("list", "l", false, "list snippets")
snippetCmd.Flags().MarkDeprecated("list", "use the \"list\" subcommand instead")
snippetCmd.Flags().BoolP("browse", "b", false, "browse snippets")
snippetCmd.Flags().MarkDeprecated("browse", "use the \"browse\" subcommand instead")
snippetCmd.Flags().StringP("delete", "d", "", "delete snippet with id")
snippetCmd.Flags().MarkDeprecated("delete", "use the \"delete\" subcommand instead")
// Create flags added in snippetCreate.go
RootCmd.AddCommand(snippetCmd)
}

0 comments on commit c79e750

Please sign in to comment.