linter
This commit is contained in:
parent
8e0b4ef21b
commit
57c53e6268
4 changed files with 6 additions and 4 deletions
|
|
@ -289,7 +289,9 @@ func (c codespace) running() bool {
|
|||
// which instructs the user to use -R instead.
|
||||
func addDeprecatedRepoShorthand(cmd *cobra.Command, target *string) error {
|
||||
cmd.Flags().StringVarP(target, "repo-deprecated", "r", "", "(Deprecated) Shorthand for --repo")
|
||||
cmd.PersistentFlags().MarkHidden("repo-deprecated")
|
||||
if err := cmd.PersistentFlags().MarkHidden("repo-deprecated"); err != nil {
|
||||
return fmt.Errorf("error marking `-r` shorthand as hidden: %w", err)
|
||||
}
|
||||
|
||||
if err := cmd.Flags().MarkShorthandDeprecated("repo-deprecated", "use `-R` instead"); err != nil {
|
||||
return fmt.Errorf("error marking `-r` shorthand as deprecated: %w", err)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func newCreateCmd(app *App) *cobra.Command {
|
|||
|
||||
createCmd.Flags().StringVarP(&opts.repo, "repo", "R", "", "repository name with owner: user/repo")
|
||||
if err := addDeprecatedRepoShorthand(createCmd, &opts.repo); err != nil {
|
||||
fmt.Fprint(app.io.ErrOut, "%v\n", err)
|
||||
fmt.Fprintf(app.io.ErrOut, "%v\n", err)
|
||||
}
|
||||
|
||||
createCmd.Flags().StringVarP(&opts.branch, "branch", "b", "", "repository branch")
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ func newDeleteCmd(app *App) *cobra.Command {
|
|||
deleteCmd.Flags().BoolVar(&opts.deleteAll, "all", false, "Delete all codespaces")
|
||||
deleteCmd.Flags().StringVarP(&opts.repoFilter, "repo", "R", "", "Delete codespaces for a `repository`")
|
||||
if err := addDeprecatedRepoShorthand(deleteCmd, &opts.repoFilter); err != nil {
|
||||
fmt.Fprint(app.io.ErrOut, "%v\n", err)
|
||||
fmt.Fprintf(app.io.ErrOut, "%v\n", err)
|
||||
}
|
||||
|
||||
deleteCmd.Flags().BoolVarP(&opts.skipConfirm, "force", "f", false, "Skip confirmation for codespaces that contain unsaved changes")
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ func newListCmd(app *App) *cobra.Command {
|
|||
listCmd.Flags().IntVarP(&opts.limit, "limit", "L", 30, "Maximum number of codespaces to list")
|
||||
listCmd.Flags().StringVarP(&opts.repo, "repo", "R", "", "Repository name with owner: user/repo")
|
||||
if err := addDeprecatedRepoShorthand(listCmd, &opts.repo); err != nil {
|
||||
fmt.Fprint(app.io.ErrOut, "%v\n", err)
|
||||
fmt.Fprintf(app.io.ErrOut, "%v\n", err)
|
||||
}
|
||||
|
||||
listCmd.Flags().StringVarP(&opts.orgName, "org", "o", "", "The `login` handle of the organization to list codespaces for (admin-only)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue