mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
fix: clap CLI definitions and manpage generation
- add #[group(skip)] to all Parser-derived structs - fix conflicts_with and arg definitions for correct CLI behavior - refactor bin entry points to support manpage generation
This commit is contained in:
@@ -84,6 +84,7 @@ pub fn s9pk() -> ParentHandler<CliContext> {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[group(skip)]
|
||||
struct S9pkPath {
|
||||
#[arg(help = "help.arg.s9pk-file-path")]
|
||||
s9pk: PathBuf,
|
||||
@@ -142,6 +143,7 @@ fn inspect() -> ParentHandler<CliContext, S9pkPath> {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[group(skip)]
|
||||
struct AddImageParams {
|
||||
#[arg(help = "help.arg.image-id")]
|
||||
id: ImageId,
|
||||
@@ -176,6 +178,7 @@ async fn add_image(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[group(skip)]
|
||||
struct EditManifestParams {
|
||||
#[arg(help = "help.arg.db-apply-expr")]
|
||||
expression: String,
|
||||
@@ -221,6 +224,7 @@ async fn file_tree(
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[group(skip)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
struct CatParams {
|
||||
@@ -352,6 +356,7 @@ async fn publish(ctx: CliContext, S9pkPath { s9pk: s9pk_path }: S9pkPath) -> Res
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[group(skip)]
|
||||
struct SelectParams {
|
||||
#[arg(help = "help.arg.s9pk-file-paths")]
|
||||
s9pks: Vec<PathBuf>,
|
||||
|
||||
@@ -13,6 +13,7 @@ pub mod reader;
|
||||
pub const SIG_CONTEXT: &[u8] = b"s9pk";
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[group(skip)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct VerifyParams {
|
||||
|
||||
@@ -155,6 +155,7 @@ impl From<PackSource> for DynFileSource {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
#[group(skip)]
|
||||
pub struct PackParams {
|
||||
#[arg(help = "help.arg.input-path")]
|
||||
pub path: Option<PathBuf>,
|
||||
@@ -166,7 +167,7 @@ pub struct PackParams {
|
||||
pub icon: Option<PathBuf>,
|
||||
#[arg(long, help = "help.arg.license-path")]
|
||||
pub license: Option<PathBuf>,
|
||||
#[arg(long, conflicts_with = "no-assets", help = "help.arg.assets-path")]
|
||||
#[arg(long, conflicts_with = "no_assets", help = "help.arg.assets-path")]
|
||||
pub assets: Option<PathBuf>,
|
||||
#[arg(long, conflicts_with = "assets", help = "help.arg.no-assets")]
|
||||
pub no_assets: bool,
|
||||
@@ -281,12 +282,13 @@ pub struct ImageConfig {
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
#[group(skip)]
|
||||
struct CliImageConfig {
|
||||
#[arg(long, conflicts_with("docker-tag"), help = "help.arg.docker-build")]
|
||||
#[arg(long, conflicts_with("docker_tag"), help = "help.arg.docker-build")]
|
||||
docker_build: bool,
|
||||
#[arg(long, requires("docker-build"), help = "help.arg.dockerfile-path")]
|
||||
#[arg(long, requires("docker_build"), help = "help.arg.dockerfile-path")]
|
||||
dockerfile: Option<PathBuf>,
|
||||
#[arg(long, requires("docker-build"), help = "help.arg.workdir-path")]
|
||||
#[arg(long, requires("docker_build"), help = "help.arg.workdir-path")]
|
||||
workdir: Option<PathBuf>,
|
||||
#[arg(long, conflicts_with_all(["dockerfile", "workdir"]), help = "help.arg.docker-tag")]
|
||||
docker_tag: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user