TobyTYL / IDS721-week7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI

A command-line tool that converts TOML to JSON. Nothing more, nothing less.

Installation

Cargo

$ cargo install toml2json

Nixpkgs

nix-env --install toml2json

Usage

Convert TOML on stdin to JSON, filtering it through jq:

$ toml2json <<< 'wow = "amazing"' | jq

Produces:

{
  "wow": "amazing"
}

Convert TOML from a file and pretty-print it without jq:

$ toml2json --pretty ~/.config/kbs2/kbs2.conf

Produces:

{
  "age-backend": "RageLib",
  "error-hook": "~/.config/kbs2/hooks/error-hook-notify",
  "keyfile": "REDACTED-GO-AWAY",
  "public-key": "REDACTED-GO-AWAY",
  "reentrant-hooks": false,
  "store": "~/.kbs2-store",
  "wrapped": true,
  "generators": [
    {
      "alphabet": "abcdefghijklmnopqrstuvwxyz0123456789(){}[]-_+=",
      "length": 16,
      "name": "default"
    }
  ],
  "commands": {
    "edit": {
      "editor": "subl -w",
      "post-hook": "~/.config/kbs2/hooks/push-repo"
    },
    "new": {
      "generate-on-empty": true,
      "post-hook": "~/.config/kbs2/hooks/push-repo"
    },
    "pass": {
      "clear-after": true,
      "clear-hook": "~/.config/kbs2/hooks/pass-clear-notify",
      "clipboard-duration": 10,
      "x11-clipboard": "Clipboard"
    },
    "rm": {
      "post-hook": "~/.config/kbs2/hooks/push-repo"
    }
  }
}

About


Languages

Language:Rust 83.6%Language:Makefile 16.4%