gitea.cli.issue.ids
ids
Reading a set of issue numbers given as text: a comma list, a file, or stdin.
issue get reads several issues at once and issue list can be narrowed to a
known set, so both need the numbers as a set rather than one option value per
issue. The numbers are separated by commas, whitespace or newlines, in any mix,
so a list written by hand, one printed by jq -r '.[]', and one pasted from a
comma-separated cell all read the same. A value that is not a positive whole
number is an error naming it, rather than a number quietly dropped.
Classes
Functions:
gitea.cli.issue.ids.parse_issue_numbers
Read the issue numbers in a piece of text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The numbers, separated by commas, whitespace or newlines. |
required |
source
|
str
|
Where the text came from, for the error, e.g. "--issue-ids". |
required |
command
|
str
|
The command being run, named as the user invoked it. |
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
The numbers, in the order given, repeats included. |
Raises:
| Type | Description |
|---|---|
CommandError
|
If a value is not a positive whole number. |
Source code in src/gitea/cli/issue/ids.py
gitea.cli.issue.ids.read_issue_id_file
Read the issue numbers listed in a file, or on stdin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The value passed as --issue-id-file, or |
required |
command
|
str
|
The command being run, named as the user invoked it. |
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
The numbers, in the order listed, repeats included. |
Raises:
| Type | Description |
|---|---|
CommandError
|
If the file cannot be read, lists no number, or lists a value that is not one. A file listing nothing is an error rather than an empty result, since that is what a pipeline that failed upstream looks like. |