GithubHelp home page GithubHelp logo

prettycbor's Introduction

prettycbor

Pretty-print (diagnostic) CBOR, optionally using cbor2diag.rb.

Install cbor2diag.rb using gem install cbor-diag.

Note that this is a very simple tool; it does not parse its input but instead inserts whitespace based on very simple rules. As such, it might miss some CBOR features or emit unexpected output.

Installation

git clone https://github.com/sietseringers/prettycbor
cargo install --path prettycbor

Usage

$ prettycbor -h
Pretty-print (diagnostic) CBOR, optionally using cbor2diag.rb

Usage: prettycbor [OPTIONS] [DATA]

Arguments:
  [DATA]  Data to act on, either hexadecimal or diagnostic. If absent, stdin is read.
           If neither --hex or --diag is given, the input is parsed as hexadecimal.
           If that works, the result is passed through cbor2diag.rb and then acted upon.
           If not, the input is acting upon directly

Options:
  -e, --embedded         Let cbor2diag.rb parse embedded CBOR using its -e flag
  -i, --indent <INDENT>  Amount of spaces used for indentation [default: 2]
  -x, --hex              Force parsing input as hexadecimal which is passed through cbor2diag.rb
  -d, --diag             Force acting directly on the input
  -h, --help             Print help information
  -V, --version          Print version information

Example

$ prettycbor -e "A36362747344DEADBEEF636172728201026463626F72D8184EA163666F6F82636261726362617A"
{
  "bts": h'DEADBEEF',
  "arr": [
    1,
    2
  ],
  "cbor": 24(<<{
    "foo": [
      "bar",
      "baz"
    ]
  }>>)
}

prettycbor's People

Contributors

sietseringers avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.