Repository navigation
Read an argument file only from the first argument - #74
Merged
Merged
Conversation
Expanding @path wherever an operand is read made every operand that starts with @ a file name: a key such as @id failed, or, with a file of that name there, silently ran another command. The first word is the one word that can't be data, and a whole command line fits in the file, so only it is expanded now; the words after it follow the file's lines as typed. The parser no longer needs to tell an option's value from a new word, so expansion moves out of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aoreshkov
force-pushed
the
cli-kit-argument-file-first-word
branch
from
November 5, 2026 21:00
be02bdb to
7e0d78e
Compare
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.
Argument files now count only as the first argument:
tool @args.txt. Every later word is taken as typed.As released in 0.4.0,
@pathwas read as a file wherever a new option or operand could start, so any operand that starts with@became a file name. Trying it on delva-cli, which hasn't turned argument files on:search kv @id 42failed with exit 66, and needed@@id. Keys such as@id,@typeand@timestampare ordinary in JSON.idin the working directory, the same command read that file's lines as arguments, printedno hitsand exited 0.search kv @.name adagotcan't read argument file '.name'instead of the command's own hint.The first word is the one that can't be data in a program with subcommands, and a whole command line fits in a file, so nothing is lost but mixing the two forms.
expandArgumentFilereplaces a first@pathwith the file's lines and leaves the rest as typed, sotool @args.txt $.ordersworks.@@xas the first word is the literal@x, for a program whose root takes operands. The parser no longer has to tell an option's value from a new word, soParser.expand,ReadingandtakesNextTokenare gone.tool query @args.txtandtool --width 40 @args.txt. The second isunknown subcommand '@args.txt', so options go in the file or after it.Start with @file to read arguments from it, one per line; @@ for a literal @.@word. Past the first word, such a word is an operand or a mistake, and names no command either way.demo store @args.txt qleaves the completion tests, since that line no longer means anything.Changedline in cli-kit's changelog. The API is experimental and its signature doesn't change, so the ABI dump doesn't either../gradlew checkis green on Windows, where the bash completion tests are skipped; CI runs them on Linux.After cli-kit 0.5.0 is released, delva-cli can turn argument files on with no change to its operands.
🤖 Generated with Claude Code