Skip to content

gh repo set-default --view cannot be used without passing repository in non-interactive context #7442

@Jackenmen

Description

@Jackenmen

Describe the bug

gh repo set-default --view shows "repository required when not running interactively" message when run in a non-interactive context.

Version:

gh version 2.29.0 (2023-05-10)
https://github.com/cli/cli/releases/tag/v2.29.0

Steps to reproduce the behavior

  1. Run gh repo set-default --view | cat (| cat used to imitate non-interactive context)
  2. See error:
repository required when not running interactively

Usage:  gh repo set-default [<repository>] [flags]

Flags:
  -u, --unset   unset the current default repository
  -v, --view    view the current default repository

Expected vs actual behavior

I expected gh repo set-default --view to just show the repository name, same as it does in an interactive context but instead, I was informed that I need to pass the repository, even though that parameter isn't used for anything when --view flag is used.

Logs

❯ gh repo set-default --view | cat      
repository required when not running interactively

Usage:  gh repo set-default [<repository>] [flags]

Flags:
  -u, --unset   unset the current default repository
  -v, --view    view the current default repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions