Skip to content

kellpossible/json-patch-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published