Skip to content

Commit c79e750

Browse files
authored
Merge pull request #629 from bmeneguele/fix-deprecate-flags
mr,issue,snippet: make shorthand flags deprecated
2 parents f0c60c5 + 8b27899 commit c79e750

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

cmd/issue.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ var issueCmd = &cobra.Command{
3636

3737
func init() {
3838
issueCmd.Flags().BoolP("list", "l", false, "list issues on a remote")
39+
issueCmd.Flags().MarkDeprecated("list", "use the \"list\" subcommand instead")
3940
issueCmd.Flags().BoolP("browse", "b", false, "view issue <id> in a browser")
41+
issueCmd.Flags().MarkDeprecated("browse", "use the \"browse\" subcommand instead")
4042
issueCmd.Flags().StringP("close", "d", "", "close issue <id> on remote")
43+
issueCmd.Flags().MarkDeprecated("close", "use the \"close\" subcommand instead")
4144
RootCmd.AddCommand(issueCmd)
4245
}

cmd/mr.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ var mrCmd = &cobra.Command{
3737

3838
func init() {
3939
mrCmd.Flags().BoolP("list", "l", false, "list merge requests on a remote")
40+
mrCmd.Flags().MarkDeprecated("list", "use the \"list\" subcommand instead")
4041
mrCmd.Flags().BoolP("browse", "b", false, "view merge request <id> in a browser")
42+
mrCmd.Flags().MarkDeprecated("browse", "use the \"browse\" subcommand instead")
4143
mrCmd.Flags().StringP("close", "d", "", "close merge request <id> on remote")
44+
mrCmd.Flags().MarkDeprecated("close", "use the \"close\" subcommand instead")
4245
RootCmd.AddCommand(mrCmd)
4346
}

cmd/snippet.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ var (
5252
func init() {
5353
snippetCmd.PersistentFlags().BoolVarP(&global, "global", "g", false, "create as a personal snippet")
5454
snippetCmd.Flags().BoolP("list", "l", false, "list snippets")
55+
snippetCmd.Flags().MarkDeprecated("list", "use the \"list\" subcommand instead")
5556
snippetCmd.Flags().BoolP("browse", "b", false, "browse snippets")
57+
snippetCmd.Flags().MarkDeprecated("browse", "use the \"browse\" subcommand instead")
5658
snippetCmd.Flags().StringP("delete", "d", "", "delete snippet with id")
59+
snippetCmd.Flags().MarkDeprecated("delete", "use the \"delete\" subcommand instead")
5760
// Create flags added in snippetCreate.go
5861
RootCmd.AddCommand(snippetCmd)
5962
}

0 commit comments

Comments
 (0)