Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add json output #13

Merged
merged 3 commits into from
Apr 15, 2024
Merged

Feat: add json output #13

merged 3 commits into from
Apr 15, 2024

Conversation

jianglu
Copy link
Contributor

@jianglu jianglu commented Apr 15, 2024

Add JSON output capability, the output result can be directly parsed by the jq JSON parser through a pipe

lok -o=json .

{
    "total": {
        "code": 111269,
        "comment": 66367,
        "blank": 17275,
        "file": 222,
        "size": "8.97 MB"
    },
    "items": [{
        "language": "Java",
        "code": 111101,
        "comment": 66367,
        "blank": 17250,
        "file": 221,
        "size": "8.96 MB"
    }, {
        "language": "Markdown",
        "code": 168,
        "comment": 0,
        "blank": 25,
        "file": 1,
        "size": "12.59 KB"
    }]
}
lok -o=json . | jq '.items[] | select(.language == "Java")'

{
  "language": "Java",
  "code": 111101,
  "comment": 66367,
  "blank": 17250,
  "file": 221,
  "size": "8.96 MB"
}

@wyhaya wyhaya merged commit ec9be45 into wyhaya:main Apr 15, 2024
8 checks passed
@wyhaya
Copy link
Owner

wyhaya commented Apr 15, 2024

v0.2.5 has been released, thanks!

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