Skip to content

Commit

Permalink
update CLI instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
anweiss committed Nov 17, 2020
1 parent d969bf1 commit 1dc8c5f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,13 +73,13 @@ If using Docker:
docker run -it --rm -v $PWD:/cddl -w /cddl ghcr.io/anweiss/cddl-cli:<version> help
```

You can validate JSON documents using the provided CLI:
You can validate JSON documents:

```sh
cddl validate --cddl <FILE.cddl> [FILE.json]...
```

You can validate CBOR files as follows:
You can validate CBOR files:

```sh
cddl validate --cddl <FILE.cddl> [FILE.cbor]...
Expand Down
41 changes: 31 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -88,13 +109,13 @@
//! docker run -it --rm -v $PWD:/cddl -w /cddl ghcr.io/anweiss/cddl-cli:<version> help
//! ```
//!
//! You can validate JSON documents using the provided CLI:
//! You can validate JSON documents:
//!
//! ```sh
//! cddl validate --cddl <FILE.cddl> [FILE.json]...
//! ```
//!
//! You can validate CBOR files as follows:
//! You can validate CBOR files:
//!
//! ```sh
//! cddl validate --cddl <FILE.cddl> [FILE.cbor]...
Expand Down

0 comments on commit 1dc8c5f

Please sign in to comment.