Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Inconsistent use of curly braces and square brackets for command args syntax e.g. {args} and [args] respectively #10432

Copy link
Copy link

Description

@iamazeem
Issue body actions

Describe the bug

As mentioned in the title, the command args syntax is inconsistent.

Affected version

$ gh --version 
gh version 2.67.0 (2025-02-11)
https://github.com/cli/cli/releases/tag/v2.67.0

Steps to reproduce the behavior

  • Use regex Use:\s+".* \{.*\}.*" to find occurrences with curly braces

Here's a list of such occurrences from VSCode:

20 results - 19 files

pkg/cmd/alias/delete/delete.go:
  28: Use:   "delete {<alias> | --all}",

pkg/cmd/extension/command.go:
  423: 		Use:   "upgrade {<name> | --all}",

pkg/cmd/gist/delete/delete.go:
  38: Use:   "delete {<id> | <url>}",

pkg/cmd/gist/edit/edit.go:
  59: Use:   "edit {<id> | <url>} [<filename>]",

pkg/cmd/gist/rename/rename.go:
  38: Use:   "rename {<id> | <url>} <oldFilename> <newFilename>",

pkg/cmd/issue/close/close.go:
  38: Use:   "close {<number> | <url>}",

pkg/cmd/issue/comment/comment.go:
  25: Use:   "comment {<number> | <url>}",

pkg/cmd/issue/delete/delete.go:
  41: Use:   "delete {<number> | <url>}",

pkg/cmd/issue/develop/develop.go:
  45: Use:   "develop {<number> | <url>}",

pkg/cmd/issue/edit/edit.go:
  52: Use:   "edit {<numbers> | <urls>}",

pkg/cmd/issue/lock/lock.go:
  128: Use:   "lock {<number> | <url>}",
  171: Use:   "unlock {<number> | <url>}",

pkg/cmd/issue/pin/pin.go:
  35: Use:   "pin {<number> | <url>}",

pkg/cmd/issue/reopen/reopen.go:
  36: Use:   "reopen {<number> | <url>}",

pkg/cmd/issue/transfer/transfer.go:
  35: Use:   "transfer {<number> | <url>} <destination-repo>",

pkg/cmd/issue/unpin/unpin.go:
  35: Use:   "unpin {<number> | <url>}",

pkg/cmd/issue/view/view.go:
  49: Use:   "view {<number> | <url>}",

pkg/cmd/pr/close/close.go:
  40: Use:   "close {<number> | <url> | <branch>}",

pkg/cmd/pr/reopen/reopen.go:
  32: Use:   "reopen {<number> | <url> | <branch>}",

pkg/cmd/repo/license/view/view.go:
  37: Use:   "view {<license-key> | <SPDX-ID>}",

The majority of the commands are using square brackets syntax:

  • curly braces (Use:\s+".* \{.*\}.*") (20 results)
  • square brackets (Use:\s+".* \[.*\].*") (75 results)

Expected vs actual behavior

The syntax should be consistent.

Logs

N/A

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomemore-info-neededMore info needed from user/contributorMore info needed from user/contributorpriority-3Affects a small number of users or is largely cosmeticAffects 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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.