Skip to content

Commit 70ee1cb

Browse files
authored
docs: update cli readme (#2601)
1 parent 9725320 commit 70ee1cb

File tree

2 files changed

+25
-54
lines changed

2 files changed

+25
-54
lines changed

hugr-cli/README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,28 @@ cargo install hugr-cli
2424
This will install the `hugr` binary. Running `hugr --help` shows:
2525

2626
```
27-
Validate a HUGR.
27+
HUGR CLI tools.
2828
29-
Usage: hugr [OPTIONS] <INPUT>
29+
Usage: hugr [OPTIONS] <COMMAND>
3030
31-
Arguments:
32-
<INPUT>
31+
Commands:
32+
validate Validate a HUGR package
33+
gen-extensions Write standard extensions out in serialized form
34+
mermaid Write HUGR as mermaid diagrams
35+
convert Convert between different HUGR envelope formats
36+
help Print this message or the help of the given subcommand(s)
3337
3438
Options:
35-
-m, --mermaid Visualise with mermaid.
36-
-n, --no-validate Skip validation.
37-
-v, --verbose... Increase logging verbosity
38-
-q, --quiet... Decrease logging verbosity
39-
-h, --help Print help
40-
-V, --version Print version
39+
-v, --verbose... Increase logging verbosity
40+
-q, --quiet... Decrease logging verbosity
41+
-h, --help Print help
42+
-V, --version Print version
43+
```
44+
45+
Refer to the help for each subcommand for more information, e.g.
46+
47+
```
48+
hugr validate --help
4149
```
4250

4351

hugr-cli/src/lib.rs

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,14 @@
99
//! directory](https://doc.rust-lang.org/book/ch14-04-installing-binaries.html)
1010
//! in your path.
1111
//!
12-
//! The CLI provides two subcommands:
13-
//!
14-
//! - `validate` for validating HUGR files.
15-
//! - `mermaid` for visualizing HUGR files as mermaid diagrams.
16-
//!
17-
//! ### Validate
18-
//!
19-
//! Validate and visualize a HUGR file
20-
//!
21-
//! Usage: `hugr validate [OPTIONS] [INPUT]`
22-
//!
23-
//! ```text
24-
//! Options:
25-
//! -v, --verbose... Increase logging verbosity
26-
//! -q, --quiet... Decrease logging verbosity
27-
//! -h, --help Print help (see more with '--help')
28-
//! -V, --version Print version
29-
//!
30-
//! Input:
31-
//! --no-std Don't use standard extensions when validating hugrs. Prelude is still used.
32-
//! -e, --extensions <EXTENSIONS> Paths to serialised extensions to validate against.
33-
//! --hugr-json Read the input as a HUGR JSON file instead of an envelope
34-
//! [INPUT] Input file. Defaults to `-` for stdin
12+
//! The top level help can be accessed with:
13+
//! ```sh
14+
//! hugr --help
3515
//! ```
3616
//!
37-
//! ### Mermaid
38-
//!
39-
//! Write HUGR as mermaid diagrams
40-
//!
41-
//! Usage: `hugr mermaid [OPTIONS] [INPUT]`
42-
//!
43-
//! ```text
44-
//! Options:
45-
//! --validate Validate before rendering, includes extension inference.
46-
//! -o, --output <OUTPUT> Output file '-' for stdout [default: -]
47-
//! -v, --verbose... Increase logging verbosity
48-
//! -q, --quiet... Decrease logging verbosity
49-
//! -h, --help Print help (see more with '--help')
50-
//! -V, --version Print version
51-
//!
52-
//! Input:
53-
//! --no-std Don't use standard extensions when validating hugrs. Prelude is still used.
54-
//! -e, --extensions <EXTENSIONS> Paths to serialised extensions to validate against.
55-
//! --hugr-json Read the input as a HUGR JSON file instead of an envelope
56-
//! [INPUT] Input file. Defaults to `-` for stdin.
17+
//! Refer to the help for each subcommand for more information, e.g.
18+
//! ```sh
19+
//! hugr validate --help
5720
//! ```
5821
5922
use clap::{Parser, crate_version};
@@ -87,7 +50,7 @@ pub struct CliArgs {
8750
#[derive(Debug, clap::Subcommand)]
8851
#[non_exhaustive]
8952
pub enum CliCommand {
90-
/// Validate and visualize a HUGR file.
53+
/// Validate a HUGR package.
9154
Validate(validate::ValArgs),
9255
/// Write standard extensions out in serialized form.
9356
GenExtensions(extensions::ExtArgs),

0 commit comments

Comments
 (0)