Skip to content

Commit c7bbc5f

Browse files
"humility spi" should take an optional device + "humility doc" (#110)
This adds a device parameter to the "humility spi" command, allowing for a CS other than that associated with device 0 to be used. By default, the device is 0. Broadly unrelated, this also adds a "humility doc" command that provides more in-depth documentation for a specified command. This documentation is provided in situ in the command itself in the form of rustdoc, which is both used to create the input for the "humility doc" command and to create the documentation in README.md. This also fixes #15. Note that "humility doc" requires the installation of "cargo-readme", which in turn hit an annoying GH CI issue. Thank you @sunshowers for pointing us in the right direction! https://twitter.com/sunshowers6/status/1504174123005603841 Co-authored-by: Steve Klabnik <[email protected]>
1 parent a561031 commit c7bbc5f

File tree

17 files changed

+680
-58
lines changed

17 files changed

+680
-58
lines changed

.github/buildomat/jobs/build-and-test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ fi
3434
pkg list -v "${need[@]}"
3535

3636
cargo --version
37+
cargo install cargo-readme
3738
rustc --version
3839

3940
banner test

.github/workflows/ci.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
toolchain: ${{ env.MSRV }}
2323
override: true
2424
- uses: Swatinem/rust-cache@v1
25+
- name: Install cargo-readme
26+
uses: baptiste0928/cargo-install@v1
27+
with:
28+
crate: cargo-readme
2529
- uses: actions-rs/cargo@v1
2630
with:
2731
command: check
@@ -41,6 +45,10 @@ jobs:
4145
toolchain: stable
4246
override: true
4347
- uses: Swatinem/rust-cache@v1
48+
- name: Install cargo-readme
49+
uses: baptiste0928/cargo-install@v1
50+
with:
51+
crate: cargo-readme
4452
- uses: actions-rs/cargo@v1
4553
with:
4654
command: check
@@ -61,6 +69,10 @@ jobs:
6169
toolchain: ${{ env.MSRV }}
6270
override: true
6371
- uses: Swatinem/rust-cache@v1
72+
- name: Install cargo-readme
73+
uses: baptiste0928/cargo-install@v1
74+
with:
75+
crate: cargo-readme
6476
- uses: actions-rs/cargo@v1
6577
with:
6678
command: test
@@ -82,6 +94,10 @@ jobs:
8294
override: true
8395
components: clippy
8496
- uses: Swatinem/rust-cache@v1
97+
- name: Install cargo-readme
98+
uses: baptiste0928/cargo-install@v1
99+
with:
100+
crate: cargo-readme
85101
- uses: actions-rs/cargo@v1
86102
with:
87103
command: clippy

.github/workflows/nightly.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
toolchain: stable
2121
override: true
2222
- uses: Swatinem/rust-cache@v1
23+
- name: Install cargo-readme
24+
uses: baptiste0928/cargo-install@v1
25+
with:
26+
crate: cargo-readme
2327
- uses: actions-rs/cargo@v1
2428
with:
2529
command: build

Cargo.lock

Lines changed: 68 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"cmd/apptable",
1414
"cmd/dashboard",
1515
"cmd/diagnose",
16+
"cmd/doc",
1617
"cmd/dump",
1718
"cmd/etm",
1819
"cmd/gpio",
@@ -52,6 +53,10 @@ debug = true
5253
inherits = "dev"
5354
debug = false # default true
5455

56+
[build-dependencies]
57+
cargo_metadata = "0.12.0"
58+
anyhow = "1.0.32"
59+
5560
[dependencies]
5661
pmbus = { git = "https://github.com/oxidecomputer/pmbus" }
5762
hif = { git = "https://github.com/oxidecomputer/hif" }
@@ -62,6 +67,7 @@ humility-cmd = { path = "./humility-cmd" }
6267
cmd-apptable = { path = "./cmd/apptable", package = "humility-cmd-apptable" }
6368
cmd-dashboard = { path = "./cmd/dashboard", package = "humility-cmd-dashboard" }
6469
cmd-diagnose = { path = "./cmd/diagnose", package = "humility-cmd-diagnose" }
70+
cmd-doc = { path = "./cmd/doc", package = "humility-cmd-doc" }
6571
cmd-dump = { path = "./cmd/dump", package = "humility-cmd-dump" }
6672
cmd-etm = { path = "./cmd/etm", package = "humility-cmd-etm" }
6773
cmd-flash = { path = "./cmd/flash", package = "humility-cmd-flash" }

0 commit comments

Comments
 (0)