You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix: Make token argument required for decode and validate commands (#2)
* feat: add interactive mode with welcome animation
* fix: make token argument required for decode and validate commands
This commit addresses a UX issue where running 'jetta decode' or 'jetta
validate' without arguments would silently wait for stdin input with no
prompt or feedback, confusing users who expected an error message.
Changes:
- Make token parameter required (String instead of Option<String>)
- File flag (--file) takes precedence over token argument
- Explicit stdin reading via '-' argument (e.g., 'echo token | jetta decode -')
- Clap now shows standard error when token is missing
- Update help text to clarify stdin usage with '-'
BREAKING CHANGE: Token argument is now required. To read from stdin,
explicitly use '-' as the token argument instead of relying on implicit
stdin reading when token is omitted.
* test: add integration tests for required token argument
Add comprehensive integration tests to verify the new required token
behavior:
- test_decode_requires_token: Verifies decode shows error when TOKEN missing
- test_validate_requires_token: Verifies validate shows error when TOKEN missing
- test_decode_explicit_stdin: Documents explicit stdin usage with '-' argument
- test_file_takes_precedence: Verifies --file flag takes precedence over token arg
Also adds tempfile dev-dependency for file precedence testing.
Test coverage: 36 tests total (22 unit + 14 integration)
* docs: update README and CHANGELOG for required token argument
Update documentation to reflect the breaking changes in token argument
handling:
README.md:
- Update 'Quick Start' section to show explicit stdin with '-'
- Update 'decode' command documentation with required TOKEN argument
- Update 'validate' command documentation with required TOKEN argument
- Document file precedence behavior
- Add new 'Common Errors' section with troubleshooting for:
- Missing token argument error
- Empty stdin error
- Malformed JWT error
CHANGELOG.md:
- Update [Unreleased] section for v0.2.0
- Document interactive mode and animation features
- Document breaking changes with BREAKING prefix
- Document the UX bug fix
- Note explicit stdin support via '-'
These docs changes complete the breaking change to require explicit
token arguments and stdin handling.
* fix: resolve clippy deprecation warning in tests
Replace deprecated Command::cargo_bin() with assert_cmd::Command::new()
and cargo_bin!() macro to avoid deprecation warnings when running
clippy with -D warnings.
This ensures CI passes with strict clippy checks.
* docs: add mandatory clippy check requirements to AGENTS.md
Add critical quality check instructions to prevent CI breakage.
This is the 3rd time we've broken CI by not running clippy with
-D warnings before committing. The new instructions mandate:
1. Run cargo fmt --all -- --check
2. Run cargo clippy --all-targets --all-features -- -D warnings
3. Run cargo test
4. Only THEN commit
These match our exact CI/CD settings and will prevent future breakage.