From 1dc8c5f7f2ff75e4c3f6149e6fd7fad0e53f152c Mon Sep 17 00:00:00 2001 From: anweiss <2326106+anweiss@users.noreply.github.com> Date: Tue, 17 Nov 2020 11:48:53 -0500 Subject: [PATCH] update CLI instructions --- Cargo.toml | 2 +- README.md | 28 +++++++++++++++++++++++++--- src/lib.rs | 41 +++++++++++++++++++++++++++++++---------- 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f439e847..27a199ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ std = ["serde_json", "serde_cbor", "serde", "chrono", "wasm-bindgen", "clap", "c lsp = ["std"] [[bin]] -name = "cli" +name = "cddl" required-features = ["std"] path = "src/bin/cli.rs" test = false diff --git a/README.md b/README.md index fdb95d42..46a00ab8 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,29 @@ Rust is a systems programming language designed around safety and is ideally-sui ## CLI -A CLI has been made available for various platforms and as a Docker image. The binary can be downloaded from GitHub [Releases](https://github.com/anweiss/cddl/releases). The tool supports parsing of `.cddl` files for verifying conformance against RFC 8610. It can also be used to validate `.json` documents and `.cbor` binary files against `.cddl` documents. Detailed information about the JSON and CBOR validation implementation can be found in the sections below. Instructions for using the tool can be viewed by executing the `help` subcommand: +A CLI is available for various platforms. The tool supports parsing of `.cddl` files for verifying conformance against RFC 8610. It can also be used to validate `.json` documents and `.cbor` binary files against `.cddl` documents. Detailed information about the JSON and CBOR validation implementation can be found in the sections below. + +### Installation + +#### GitHub Releases + +Binaries for Linux, macOS and Windows can be downloaded from GitHub [Releases](https://github.com/anweiss/cddl/releases). + +#### Cargo + +```sh +cargo install cddl +``` + +#### Docker + +```sh +docker pull ghcr.io/anweiss/cddl-cli:latest +``` + +### Usage + +Instructions for using the tool can be viewed by executing the `help` subcommand: ```sh cddl help @@ -51,13 +73,13 @@ If using Docker: docker run -it --rm -v $PWD:/cddl -w /cddl ghcr.io/anweiss/cddl-cli: help ``` -You can validate JSON documents using the provided CLI: +You can validate JSON documents: ```sh cddl validate --cddl [FILE.json]... ``` -You can validate CBOR files as follows: +You can validate CBOR files: ```sh cddl validate --cddl [FILE.cbor]... diff --git a/src/lib.rs b/src/lib.rs index 51783c1d..9e2a11b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,14 +63,35 @@ //! //! ## CLI //! -//! A CLI has been made available for various platforms and as a Docker image. -//! The binary can be downloaded from GitHub -//! [Releases](https://github.com/anweiss/cddl/releases). The tool supports -//! parsing of `.cddl` files for verifying conformance against RFC 8610. It can -//! also be used to validate `.json` documents and `.cbor` binary files against -//! `.cddl` documents. Detailed information about the JSON and CBOR validation -//! implementation can be found in the sections below. Instructions for using -//! the tool can be viewed by executing the `help` subcommand: +//! A CLI is available for various platforms. The tool supports parsing of +//! `.cddl` files for verifying conformance against RFC 8610. It can also be +//! used to validate `.json` documents and `.cbor` binary files against `.cddl` +//! documents. Detailed information about the JSON and CBOR validation +//! implementation can be found in the sections below. +//! +//! ### Installation +//! +//! #### GitHub Releases +//! +//! Binaries for Linux, macOS and Windows can be downloaded from GitHub +//! [Releases](https://github.com/anweiss/cddl/releases). +//! +//! #### Cargo +//! +//! ```sh +//! cargo install cddl +//! ``` +//! +//! #### Docker +//! +//! ```sh +//! docker pull ghcr.io/anweiss/cddl-cli:latest +//! ``` +//! +//! ### Usage +//! +//! Instructions for using the tool can be viewed by executing the `help` +//! subcommand: //! //! ```sh //! cddl help @@ -88,13 +109,13 @@ //! docker run -it --rm -v $PWD:/cddl -w /cddl ghcr.io/anweiss/cddl-cli: help //! ``` //! -//! You can validate JSON documents using the provided CLI: +//! You can validate JSON documents: //! //! ```sh //! cddl validate --cddl [FILE.json]... //! ``` //! -//! You can validate CBOR files as follows: +//! You can validate CBOR files: //! //! ```sh //! cddl validate --cddl [FILE.cbor]...