diff --git a/src/commands/issue/issue-list.ts b/src/commands/issue/issue-list.ts index 8202885..fc6c311 100644 --- a/src/commands/issue/issue-list.ts +++ b/src/commands/issue/issue-list.ts @@ -155,6 +155,14 @@ export const listCommand = new Command() console.error(`No projects found matching: ${project}`) Deno.exit(1) } + if (!Deno.stdin.isTerminal()) { + console.error( + `Project "${project}" not found. Similar projects: ${ + Object.values(projectOptions).join(", ") + }`, + ) + Deno.exit(1) + } projectId = await selectOption("Project", project, projectOptions) } } @@ -173,6 +181,7 @@ export const listCommand = new Command() allAssignees, limit === 0 ? undefined : limit, projectId, + sort, ) spinner?.stop() const issues = result.issues?.nodes || [] diff --git a/src/utils/linear.ts b/src/utils/linear.ts index 2cd2648..3ac4afb 100644 --- a/src/utils/linear.ts +++ b/src/utils/linear.ts @@ -361,11 +361,13 @@ export async function fetchIssuesForState( allAssignees = false, limit?: number, projectId?: string, + sortParam?: "manual" | "priority", ) { - const sort = getOption("issue_sort") as "manual" | "priority" | undefined + const sort = sortParam ?? + getOption("issue_sort") as "manual" | "priority" | undefined if (!sort) { console.error( - "Sort must be provided via configuration file or LINEAR_ISSUE_SORT environment variable", + "Sort must be provided via --sort parameter, configuration file, or LINEAR_ISSUE_SORT environment variable", ) Deno.exit(1) }