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

Add --json output flag to brotab list #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pschmitt
Copy link

@pschmitt pschmitt commented Dec 19, 2023

This adds a --json flag to brotab list.

The output format looks like this:

[{"id": "a.1.186","title": "Add --json output flag to brotab list by pschmitt · Pull Request #113 · balta2ar/brotab","url": "https://github.com/balta2ar/brotab/pull/113"}]

@jackmac92
Copy link

jackmac92 commented Oct 8, 2024

Was hoping I'd find an open issue/PR re: json output. I'd find it really useful
is this something you're interested in @balta2ar ?

edit: using this for now

brotab list |
  # Converts each line of tab delimited output to a JSON list
  awk -F'\t' '{
   printf "[";
    for(i=1; i<=NF; i++) {
      printf "%s\"%s\"", (i>1 ? "," : ""), $i
    }
   print "]"
  }' |
  # Creates an object to add labels
  jq -c '{ id: .[0], title: .[1], url: .[2] }'

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