json-patch-cli

Crates.iojson-patch-cli
lib.rsjson-patch-cli
version0.1.5
sourcesrc
created_at2024-10-31 23:45:27.860724
updated_at2024-11-01 05:09:15.450015
descriptionA CLI command to perform JSON RFC 6902 patching, merging and editing operations
homepage
repositoryhttps://github.com/kellpossible/json-patch-cli
max_upload_size
id1431081
size33,275
Luke Frisken (kellpossible)

documentation

README

json-patch-cli badge

A CLI command to perform JSON RFC 6902 patching, merging and editing operations.

This project provides a CLI command json-patch which uses the brilliant work from the json-patch crate.

Installation

cargo install --locked json-patch-cli

Usage

Usage: json-patch <COMMAND>

Commands:
  diff         Calculate the difference between two json files to create a JSON (RFC 6902) patch
  apply        Apply a JSON (RFC 6902) patch
  edit         Edit a JSON (RFC 6902) patch, by editing a patched version of the input using a text editor
  completions  Generate command line completions script
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

diff Command

Calculate the difference between two json files to create a JSON (RFC 6902) patch

Usage: json-patch diff <FROM> <TO>

Arguments:
  <FROM>
  <TO>

Options:
  -h, --help           Print help

apply Command

Apply a JSON (RFC 6902) patch

Usage: json-patch apply --patch <PATCH> <INPUT>

Arguments:
  <INPUT>

Options:
  -p, --patch <PATCH>
  -h, --help           Print help

edit Command

Edit or create a JSON (RFC 6902) patch, by editing a patched version of the input using a text editor

Usage: json-patch edit [OPTIONS] --patch <PATCH> <INPUT>

Arguments:
  <INPUT>


Options:
  -w, --watch
          Enable live editing of the patch file

  -p, --patch <PATCH>
          Path to JSON patch file.

          If the patch file does not yet exist, this command will create a new one.

  -e, --editor <EDITOR>
          [default: vim]

  -h, --help
          Print help (see a summary with '-h')
Commit count: 19

cargo fmt