Alias list as ls for all commands (#5214)

I always get tripped up whenever trying to list my codespaces, adding
`ls` as an alias to `list` feels natural enough.

Co-authored-by: Mislav Marohnić <mislav@github.com>
This commit is contained in:
Christian Gregg 2022-02-17 12:53:42 +00:00 committed by GitHub
parent c2a9c5a74b
commit c5dbf20ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 50 additions and 36 deletions

View file

@ -24,8 +24,9 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "List your aliases",
Use: "list",
Short: "List your aliases",
Aliases: []string{"ls"},
Long: heredoc.Doc(`
This command prints out all of the aliases gh is configured to use.
`),

View file

@ -16,9 +16,10 @@ func newListCmd(app *App) *cobra.Command {
var exporter cmdutil.Exporter
listCmd := &cobra.Command{
Use: "list",
Short: "List your codespaces",
Args: noArgsConstraint,
Use: "list",
Short: "List your codespaces",
Aliases: []string{"ls"},
Args: noArgsConstraint,
RunE: func(cmd *cobra.Command, args []string) error {
if limit < 1 {
return cmdutil.FlagErrorf("invalid limit: %v", limit)

View file

@ -23,9 +23,10 @@ func NewCmdConfigList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.
}
cmd := &cobra.Command{
Use: "list",
Short: "Print a list of configuration keys and values",
Args: cobra.ExactArgs(0),
Use: "list",
Short: "Print a list of configuration keys and values",
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
if runF != nil {
return runF(opts)

View file

@ -40,9 +40,10 @@ func NewCmdExtension(f *cmdutil.Factory) *cobra.Command {
extCmd.AddCommand(
&cobra.Command{
Use: "list",
Short: "List installed extension commands",
Args: cobra.NoArgs,
Use: "list",
Short: "List installed extension commands",
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cmds := m.List(true)
if len(cmds) == 0 {

View file

@ -35,9 +35,10 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
var flagSecret bool
cmd := &cobra.Command{
Use: "list",
Short: "List your gists",
Args: cobra.NoArgs,
Use: "list",
Short: "List your gists",
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
if opts.Limit < 1 {
return cmdutil.FlagErrorf("invalid limit: %v", opts.Limit)

View file

@ -27,9 +27,10 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "Lists GPG keys in your GitHub account",
Args: cobra.ExactArgs(0),
Use: "list",
Short: "Lists GPG keys in your GitHub account",
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
if runF != nil {
return runF(opts)

View file

@ -66,7 +66,8 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
$ gh issue list --milestone "The big 1.0"
$ gh issue list --search "error no:assignee sort:created-asc"
`),
Args: cmdutil.NoArgsQuoteReminder,
Aliases: []string{"ls"},
Args: cmdutil.NoArgsQuoteReminder,
RunE: func(cmd *cobra.Command, args []string) error {
// support `-R, --repo` override
opts.BaseRepo = f.BaseRepo

View file

@ -70,7 +70,8 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
Open the list of PRs in a web browser
$ gh pr list --web
`),
Args: cmdutil.NoArgsQuoteReminder,
Aliases: []string{"ls"},
Args: cmdutil.NoArgsQuoteReminder,
RunE: func(cmd *cobra.Command, args []string) error {
// support `-R, --repo` override
opts.BaseRepo = f.BaseRepo

View file

@ -28,9 +28,10 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "List releases in a repository",
Args: cobra.NoArgs,
Use: "list",
Short: "List releases in a repository",
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// support `-R, --repo` override
opts.BaseRepo = f.BaseRepo

View file

@ -26,9 +26,10 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "List deploy keys in a GitHub repository",
Args: cobra.ExactArgs(0),
Use: "list",
Short: "List deploy keys in a GitHub repository",
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
opts.BaseRepo = f.BaseRepo

View file

@ -40,9 +40,10 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "List recent workflow runs",
Args: cobra.NoArgs,
Use: "list",
Short: "List recent workflow runs",
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// support `-R, --repo` override
opts.BaseRepo = f.BaseRepo

View file

@ -48,7 +48,8 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
- organization: available to Actions runs within an organization
- user: available to Codespaces for your user
`),
Args: cobra.NoArgs,
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// support `-R, --repo` override
opts.BaseRepo = f.BaseRepo

View file

@ -26,9 +26,10 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "Lists SSH keys in your GitHub account",
Args: cobra.ExactArgs(0),
Use: "list",
Short: "Lists SSH keys in your GitHub account",
Aliases: []string{"ls"},
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
if runF != nil {
return runF(opts)

View file

@ -33,10 +33,11 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman
}
cmd := &cobra.Command{
Use: "list",
Short: "List workflows",
Long: "List workflow files, hiding disabled workflows by default.",
Args: cobra.NoArgs,
Use: "list",
Short: "List workflows",
Long: "List workflow files, hiding disabled workflows by default.",
Aliases: []string{"ls"},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// support `-R, --repo` override
opts.BaseRepo = f.BaseRepo