Stop presenting linear api's positional as a subcommand in help - #288
Merged
Merged
Conversation
`linear --help` listed `api [query]` and `linear api --help` said `Usage: linear api [query]`, styled exactly like the real subcommands, so `linear api query '<document>'` read as the natural invocation. It fails with "Too many arguments: <document>", which looks like the query was parsed and rejected, and `query` is a genuine subcommand elsewhere (`issue query`). This is a help-text fix only; parsing, options, exit codes, and output are unchanged. The positional is now labelled `[graphqlDocument]` (camelCase like every other multiword positional, and unlike the kebab-case subcommands it was being mistaken for), the description says the document is the only argument and that api has no subcommands, and an Examples section covers the inline, named-query-with-variables, stdin, file, and --paginate forms. Because cliffy prints the command help above the "Too many arguments" error, the mistaken invocation now explains itself. The skill template carries the same note and the generated skill docs are regenerated. The reporter also suggested rejecting unknown subcommands so that `linear api query --help` stops exiting 0 with api's help. That is cliffy's generic --help precedence (`linear issue view FOO --help` behaves the same) and changing it would alter behaviour, so it is deliberately left alone. Github-Issue: Fixes #286 Github-Issue-Url: #286 Claude-Session: https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
linear --helplistedapi [query]andlinear api --helpsaidUsage: linear api [query], styled like the real subcommands, solinear api query '<document>'read as the natural invocation and then failed with a misleading "Too many arguments: ".This is a help-text and docs fix only. Parsing, options, exit codes and output are unchanged (
linear api query '...'still exits 2 with the same error, and the added tests pin that).[graphqlDocument]in bothlinear --helpandlinear api --help. camelCase matches every other multiword positional (issueId,urlOrIssueId) and, unlike a kebab-case label, cannot be mistaken for one of the kebab-case subcommands.apihas no subcommands. cliffy prints the command help right above the "Too many arguments" error, so the mistaken invocation now explains itself.Examples:section covers inline, named query with--variable, stdin pipe,-with a file, and--paginate. Each example was run as written against a mock GraphQL server.SKILL.mdandreferences/api.mdare regenerated withdeno task generate-skill-docs(idempotent).Deliberately not done: rejecting unknown subcommands so
linear api query --helpstops exiting 0. That is cliffy's generic--helpprecedence (linear issue view FOO --helpbehaves the same), and changing it would be a behaviour change.Fixes #286
https://claude.ai/code/session_01A9qEGri4p2HZMQSuYsBmub