Skip to content

Output stats command results in NSV format#7

Merged
namingbe merged 1 commit intomasterfrom
claude/stats-nsv-format-NbC04
Mar 15, 2026
Merged

Output stats command results in NSV format#7
namingbe merged 1 commit intomasterfrom
claude/stats-nsv-format-NbC04

Conversation

@namingbe
Copy link
Copy Markdown
Contributor

Summary

Changed the stats command to output structural statistics about NSV data in NSV format instead of plain text key-value pairs.

Key Changes

  • Updated the docstring to clarify that stats are printed "in NSV format"
  • Replaced individual println! statements with structured data that is encoded using the nsv::encode() function
  • Statistics are now organized as rows of key-value pairs (each stat as a 2-column row) and output as valid NSV data

Implementation Details

The statistics data is constructed as a vector of vectors, where each inner vector represents a row with two columns: the statistic name and its value. This structured format is then passed to nsv::encode() to produce properly formatted NSV output, making the stats command output consistent with the library's data format.

https://claude.ai/code/session_01UNoSXqMRouTeNhG1T4PYW3

Use nsv::encode to produce a 2-column NSV table (key, value) instead
of ad-hoc "key: value" lines, making the output machine-readable and
self-consistent with the tool's own format.

https://claude.ai/code/session_01UNoSXqMRouTeNhG1T4PYW3
@namingbe namingbe merged commit 86a6d84 into master Mar 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants