Skip to content

Commit c28f55d

Browse files
authored
docs(project): present by-name item-edit as the first-class flow (cli#13927)
Signed-off-by: Solaris-star <820622658@qq.com>
1 parent efe3f16 commit c28f55d

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

pkg/cmd/project/item-edit/item_edit.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ func NewCmdEditItem(f *cmdutil.Factory, runF func(config editItemConfig) error)
8181
Long: heredoc.Docf(`
8282
Edit a draft issue or a project item.
8383
84-
There are two ways to select the item and field to edit:
84+
The usual way to select the item and field is by name: pass the project
85+
%[1]snumber%[1]s plus %[1]s--owner%[1]s, point at the item with its issue or pull
86+
request %[1]s--url%[1]s, and name the field with %[1]s--field%[1]s. For single-select
87+
fields, %[1]s--value%[1]s is the option name.
8588
86-
- By ID: pass %[1]s--id%[1]s, %[1]s--field-id%[1]s and %[1]s--project-id%[1]s directly.
87-
- By name: pass %[1]snumber%[1]s plus %[1]s--owner%[1]s, point at the item with its
88-
issue or pull request %[1]s--url%[1]s, and name the field with %[1]s--field%[1]s.
89-
For single-select fields, %[1]s--value%[1]s is the option name.
90-
91-
In either case, the project is always selected by number and %[1]s--owner%[1]s.
89+
For scripts and machine use, you can also pass GraphQL node IDs directly with
90+
%[1]s--id%[1]s, %[1]s--field-id%[1]s and %[1]s--project-id%[1]s (and, for single-select
91+
fields, %[1]s--single-select-option-id%[1]s).
9292
9393
Note that %[1]s--url%[1]s is the issue or pull request URL, not a project URL, so its
9494
owner may differ from the project's; %[1]s--owner%[1]s selects the project.
@@ -98,13 +98,13 @@ func NewCmdEditItem(f *cmdutil.Factory, runF func(config editItemConfig) error)
9898
Remove a project item field value with %[1]s--clear%[1]s.
9999
`, "`"),
100100
Example: heredoc.Doc(`
101-
# Edit an item's text field value by node ID
102-
$ gh project item-edit --id <item-id> --field-id <field-id> --project-id <project-id> --text "new text"
103-
104101
# Set the "Status" field to "In Progress" for an issue on monalisa's project 1
105102
$ gh project item-edit 1 --owner monalisa --url https://github.com/monalisa/myproject/issues/23 --field "Status" --value "In Progress"
106103
107-
# Clear an item's field value
104+
# Edit an item's text field value by node ID (machine / scripted use)
105+
$ gh project item-edit --id <item-id> --field-id <field-id> --project-id <project-id> --text "new text"
106+
107+
# Clear an item's field value by node ID
108108
$ gh project item-edit --id <item-id> --field-id <field-id> --project-id <project-id> --clear
109109
`),
110110
Args: cobra.MaximumNArgs(1),

0 commit comments

Comments
 (0)