0xdevalias / dotfiles

devalias does dotfiles
http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/
MIT License
8 stars 1 forks source link

[bin] Improve prettyjson helper script #18

Closed 0xdevalias closed 2 years ago

0xdevalias commented 3 years ago
#!/bin/bash
# Simple JSON pretty print for contents on your cliboard
pbpaste | json_pp | pbcopy

# https://stackoverflow.com/questions/20265439/how-can-i-pretty-print-a-json-file-from-the-command-line/24951417
# TODO:
#   if Json_pp, then use that
#   if python json.tool, then use that
#   if jq, then use that
#   etc

# TODO:
#   if data being piped in, use that
#   else pbpaste
#
#   if data being piped out, allow it
#   else pbcopy