fix: Standardize output format options across all CLI commands#274
Merged
v0lkan merged 2 commits intospiffe:mainfrom Feb 5, 2026
Merged
Conversation
Implement unified format flag handling across policy and secret commands to address issue spiffe#252. This change provides consistent format options with standardized aliases across all CLI commands. Changes: - Created shared format package with standardized format handling - Supports human/h/plain/p (default), json/j, and yaml/y formats - Added comprehensive tests for format parsing and validation - Updated policy commands to use shared format utilities - policy list and policy get now support yaml format - Maintained backward compatibility with existing formats - Added tests for yaml format and format aliases - Updated secret commands with standardized formats - secret get: Changed from plain/p to human/h/plain/p for consistency - secret list: Added format support (human, json, yaml) - secret metadata get: Added format support (human, json, yaml) - Updated tests to reflect new default format (human) All commands now support the same set of format options with consistent behavior, improving user experience and enabling reliable automation. Fixes spiffe#252 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: majiayu000 <1835304752@qq.com>
Contributor
|
Can we please resolve the conflicts? Thanks for your contribution 🙏 . |
…1348 Resolved conflict in app/spike/internal/cmd/policy/format.go: - Kept the PR's implementation using shared format package - Updated test_helper.go to work with the new simpler human output format (ID/Name on separate lines instead of tabwriter columns) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
There are too many upcoming upstream changes. Will check and hopefully merge this after the next release cut. Thanks for your contributions 🙏 . |
Contributor
|
overall looking good. taking a personal note to check out for documentation drift. thanks for your contribution 🙏 . |
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
This PR fixes #252
Changes
Created shared format package () with standardized format handling
Updated policy commands to use shared format utilities
Updated secret commands with standardized formats
All commands now support the same set of format options with consistent behavior, improving user experience and enabling reliable automation.
Testing
Generated with Claude Code