Open gibson042 opened 3 months ago
The recent updates to cmd/iaviewer/main.go
focus on refining command line argument handling, enhancing error management, and improving key functions for tree reading and printing. These changes introduce a cmds
map for valid commands, restructure the ReadTree
function for better error handling, upgrade PrintKeys
to work with an ImmutableTree
, and improve key encoding.
Files | Change Summary |
---|---|
cmd/iaviewer/main.go |
Refactored command line argument handling, improved error handling, and restructured key functions (ReadTree , PrintKeys ). Added a cmds map, a new encodeData function, and updated parseWeaveKey . |
sequenceDiagram
participant User
participant Main as Main Function
participant Cmds as Commands Map
participant ReadTree as ReadTree Function
participant PrintKeys as PrintKeys Function
participant ParseWeaveKey as ParseWeaveKey Function
User->>Main: Input Command
Main->>Cmds: Validate Command
alt Valid Command
Main->>ReadTree: Read Latest Tree Version
ReadTree-->>Main: Tree Data
Main->>PrintKeys: Print Tree Keys
PrintKeys-->>Main: Printed Keys
Main->>User: Output Result
else Invalid Command
Main->>User: Print Usage Message
end
Main->>ParseWeaveKey: Parse Key
ParseWeaveKey-->>Main: Encoded Key
In the codebase deep, a rabbit did tweak,
Command lines refined, no errors to sneak.
Trees now immutable, standing so strong,
Keys printed bright, in ASCII or hex long.
WithparseWeaveKey
improved, data's intact,
Celebrate these changes, in code we trust pact!
🌟🐰✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
The first three commits are general cleanup that could be pulled out into one or more independent PRs, and the fourth is the motivator of this PR: new
iaviewer
commands for varying the amount of detail in output.data-full
outputs actual values rather than just their SHA-256 digests.hash
outputs a tree summary without including details about individual entries.Summary by CodeRabbit
New Features
Bug Fixes
Refactor