Fix CLI argument parsing and standardize help text#741
Merged
Conversation
Breaking change: Options using nargs="+" now use nargs=1, requiring
repeated flags instead of greedy parsing. For example:
Old: --format JPEG PNG
New: --format JPEG --format PNG
This fixes a bug where options placed before positional arguments would
fail to parse correctly (e.g., `ia download --format "X" myitem`).
Changes:
- Change nargs="+" to nargs=1 on all OPTIONS across 8 subcommands
- Redesign PostDataAction to accept JSON, key:value, or key=value
- Fix QueryStringAction bug when same key used across multiple flags
- Fix incorrect help text ("Identifier for the upload" in non-upload cmds)
- Fix inverted --quiet help text in ia delete
- Capitalize all help text consistently
- Add comprehensive argument parsing tests (36 tests)
- Bump version to 5.8.0.dev0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change all default={} to default=None in add_argument() calls and
add 'or {}' guards in consumers. The shared mutable dict caused
state leakage across parser reuses.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consistent with the pattern in ia_delete, ia_copy, ia_move, ia_upload, and ia_tasks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…parsing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove debug print('hi') in ia_configure.py
- Fix 'list' -> 'reviews' docstring in ia_reviews.py
- Fix 'interneratchive' typo in cli_utils.py module docstring
- Remove unused imports (MetadataAction, signal, Mapping)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- --spread → --format (no such option as --spread) - action="append" → repeated flags (PR uses custom actions and extend) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
nargs="+"now usenargs=1, requiring repeated flags instead of greedy parsing--format JPEG PNG--format JPEG --format PNGia download --format "X" myitem)PostDataActionto accept JSON,key:value, orkey=valueformatsTest plan
ia download --format "Item CDX Index" myitemnow worksia upload myitem file.txt -m title:Foo -m creator:Barworks🤖 Generated with Claude Code