crates/kiln/ents-kiln/src/toolchain/cli.rs
| 1 | //! `git ents toolchain`'s argument grammar — `figue` derive definitions |
| 2 | //! only. |
| 3 | //! |
| 4 | //! Per this project's engineering conventions, this module carries no |
| 5 | //! logic: every doc comment here becomes `--help` text, and `git-ents`'s |
| 6 | //! own `exe` module is the only place a [`ToolchainAction`] variant is |
| 7 | //! interpreted. |
| 8 | |
| 9 | use std::path::PathBuf; |
| 10 | |
| 11 | use facet::Facet; |
| 12 | use figue as args; |
| 13 | |
| 14 | /// `git ents toolchain` actions. |
| 15 | #[derive(Facet)] |
| 16 | #[repr(u8)] |
| 17 | pub enum ToolchainAction { |
| 18 | /// List the toolchains currently defined. |
| 19 | List, |
| 20 | /// Import a local directory as toolchain `name`, embedding its |
| 21 | /// contents whole (`ents_kiln::Recipe::Embedded`). |
| 22 | Import { |
| 23 | /// Name to record the toolchain under |
| 24 | /// (`refs/meta/toolchains/<name>`). |
| 25 | #[facet(args::positional)] |
| 26 | name: String, |
| 27 | /// Directory of executables to import, activated on `PATH` when |
| 28 | /// an effect declares this toolchain. |
| 29 | #[facet(args::positional)] |
| 30 | bin: PathBuf, |
| 31 | /// Key to sign with; defaults to `user.signingkey`. |
| 32 | #[facet(args::named)] |
| 33 | key: Option<PathBuf>, |
| 34 | }, |
| 35 | /// Show a toolchain's provenance. |
| 36 | View { |
| 37 | /// Name (`refs/meta/toolchains/<name>`) to view. |
| 38 | #[facet(args::positional)] |
| 39 | name: String, |
| 40 | }, |
| 41 | /// Show a toolchain's import history — the ref's own commit log. |
| 42 | Log { |
| 43 | /// Name (`refs/meta/toolchains/<name>`) to show history for. |
| 44 | #[facet(args::positional)] |
| 45 | name: String, |
| 46 | }, |
| 47 | } |