git-ents.gitmain
⌘K
foforge
cli.rs47 lines · 1.4 KB · rusthistorycomment on this file
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
9use std::path::PathBuf;
10
11use facet::Facet;
12use figue as args;
13
14/// `git ents toolchain` actions.
15#[derive(Facet)]
16#[repr(u8)]
17pub 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}