mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
help text for args
This commit is contained in:
@@ -206,16 +206,17 @@ pub async fn add_signer(ctx: RegistryContext, signer: SignerInfo) -> Result<Guid
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[ts(export)]
|
||||
pub struct EditSignerParams {
|
||||
#[arg(help = "help.arg.signer-id")]
|
||||
pub id: Guid,
|
||||
#[arg(short = 'n', long)]
|
||||
#[arg(short = 'n', long, help = "help.arg.set-signer-name")]
|
||||
pub set_name: Option<String>,
|
||||
#[arg(short = 'c', long)]
|
||||
#[arg(short = 'c', long, help = "help.arg.add-signer-contact")]
|
||||
pub add_contact: Vec<ContactInfo>,
|
||||
#[arg(short = 'k', long)]
|
||||
#[arg(short = 'k', long, help = "help.arg.add-signer-key")]
|
||||
pub add_key: Vec<AnyVerifyingKey>,
|
||||
#[arg(short = 'C', long)]
|
||||
#[arg(short = 'C', long, help = "help.arg.remove-signer-contact")]
|
||||
pub remove_contact: Vec<ContactInfo>,
|
||||
#[arg(short = 'K', long)]
|
||||
#[arg(short = 'K', long, help = "help.arg.remove-signer-key")]
|
||||
pub remove_key: Vec<AnyVerifyingKey>,
|
||||
}
|
||||
|
||||
@@ -264,12 +265,13 @@ pub async fn edit_signer(
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliAddSignerParams {
|
||||
#[arg(long = "name", short = 'n')]
|
||||
#[arg(long = "name", short = 'n', help = "help.arg.signer-name")]
|
||||
pub name: String,
|
||||
#[arg(long = "contact", short = 'c')]
|
||||
#[arg(long = "contact", short = 'c', help = "help.arg.signer-contact")]
|
||||
pub contact: Vec<ContactInfo>,
|
||||
#[arg(long = "key")]
|
||||
#[arg(long = "key", help = "help.arg.signer-key")]
|
||||
pub keys: Vec<AnyVerifyingKey>,
|
||||
#[arg(help = "help.arg.database-path")]
|
||||
pub database: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -339,6 +341,7 @@ pub async fn add_admin(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct RemoveAdminParams {
|
||||
#[arg(help = "help.arg.signer-id")]
|
||||
pub signer: Guid,
|
||||
}
|
||||
|
||||
@@ -360,7 +363,9 @@ pub async fn remove_admin(
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliAddAdminParams {
|
||||
#[arg(help = "help.arg.signer-id")]
|
||||
pub signer: Guid,
|
||||
#[arg(help = "help.arg.database-path")]
|
||||
pub database: Option<PathBuf>,
|
||||
}
|
||||
|
||||
|
||||
@@ -42,17 +42,17 @@ const DEFAULT_REGISTRY_LISTEN: SocketAddr =
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct RegistryConfig {
|
||||
#[arg(short = 'c', long = "config")]
|
||||
#[arg(short = 'c', long = "config", help = "help.arg.config-file-path")]
|
||||
pub config: Option<PathBuf>,
|
||||
#[arg(short = 'l', long = "listen")]
|
||||
#[arg(short = 'l', long = "listen", help = "help.arg.registry-listen-address")]
|
||||
pub registry_listen: Option<SocketAddr>,
|
||||
#[arg(short = 'H', long = "hostname")]
|
||||
#[arg(short = 'H', long = "hostname", help = "help.arg.registry-hostname")]
|
||||
pub registry_hostname: Vec<InternedString>,
|
||||
#[arg(short = 'p', long = "tor-proxy")]
|
||||
#[arg(short = 'p', long = "tor-proxy", help = "help.arg.tor-proxy-url")]
|
||||
pub tor_proxy: Option<Url>,
|
||||
#[arg(short = 'd', long = "datadir")]
|
||||
#[arg(short = 'd', long = "datadir", help = "help.arg.data-directory")]
|
||||
pub datadir: Option<PathBuf>,
|
||||
#[arg(short = 'u', long = "pg-connection-url")]
|
||||
#[arg(short = 'u', long = "pg-connection-url", help = "help.arg.postgres-connection-url")]
|
||||
pub pg_connection_url: Option<String>,
|
||||
}
|
||||
impl ContextConfig for RegistryConfig {
|
||||
@@ -165,6 +165,7 @@ impl Deref for RegistryContext {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Parser)]
|
||||
pub struct RegistryUrlParams {
|
||||
#[arg(help = "help.arg.registry-url")]
|
||||
pub registry: Url,
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,9 @@ pub fn db_api<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliDumpParams {
|
||||
#[arg(long = "pointer", short = 'p')]
|
||||
#[arg(long = "pointer", short = 'p', help = "help.arg.db-pointer")]
|
||||
pointer: Option<JsonPointer>,
|
||||
#[arg(help = "help.arg.database-path")]
|
||||
path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -81,7 +82,7 @@ async fn cli_dump(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct DumpParams {
|
||||
#[arg(long = "pointer", short = 'p')]
|
||||
#[arg(long = "pointer", short = 'p', help = "help.arg.db-pointer")]
|
||||
#[ts(type = "string | null")]
|
||||
pointer: Option<JsonPointer>,
|
||||
}
|
||||
@@ -97,7 +98,9 @@ pub async fn dump(ctx: RegistryContext, DumpParams { pointer }: DumpParams) -> R
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliApplyParams {
|
||||
#[arg(help = "help.arg.db-apply-expr")]
|
||||
expr: String,
|
||||
#[arg(help = "help.arg.database-path")]
|
||||
path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -152,7 +155,9 @@ async fn cli_apply(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ApplyParams {
|
||||
#[arg(help = "help.arg.db-apply-expr")]
|
||||
expr: String,
|
||||
#[arg(help = "help.arg.database-path")]
|
||||
path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ pub async fn get_info(ctx: RegistryContext) -> Result<RegistryInfo, Error> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct SetNameParams {
|
||||
#[arg(help = "help.arg.registry-name")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
@@ -104,6 +105,7 @@ pub async fn set_icon(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct CliSetIconParams {
|
||||
#[arg(help = "help.arg.icon-path")]
|
||||
pub icon: PathBuf,
|
||||
}
|
||||
|
||||
|
||||
@@ -179,11 +179,13 @@ pub async fn add_squashfs(ctx: RegistryContext, params: AddAssetParams) -> Resul
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliAddAssetParams {
|
||||
#[arg(short = 'p', long = "platform")]
|
||||
#[arg(short = 'p', long = "platform", help = "help.arg.platform")]
|
||||
pub platform: InternedString,
|
||||
#[arg(short = 'v', long = "version")]
|
||||
#[arg(short = 'v', long = "version", help = "help.arg.os-version")]
|
||||
pub version: Version,
|
||||
#[arg(help = "help.arg.asset-file-path")]
|
||||
pub file: PathBuf,
|
||||
#[arg(help = "help.arg.asset-url")]
|
||||
pub url: Url,
|
||||
}
|
||||
|
||||
|
||||
@@ -121,18 +121,20 @@ pub async fn get_squashfs(
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliGetOsAssetParams {
|
||||
#[arg(help = "help.arg.os-version")]
|
||||
pub version: Version,
|
||||
#[arg(help = "help.arg.platform")]
|
||||
pub platform: InternedString,
|
||||
#[arg(
|
||||
long = "download",
|
||||
short = 'd',
|
||||
help = "The path of the directory to download to"
|
||||
help = "help.arg.download-directory"
|
||||
)]
|
||||
pub download: Option<PathBuf>,
|
||||
#[arg(
|
||||
long = "reverify",
|
||||
short = 'r',
|
||||
help = "verify the hash of the file a second time after download"
|
||||
help = "help.arg.reverify-hash"
|
||||
)]
|
||||
pub reverify: bool,
|
||||
}
|
||||
|
||||
@@ -136,10 +136,11 @@ pub async fn sign_squashfs(ctx: RegistryContext, params: SignAssetParams) -> Res
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliSignAssetParams {
|
||||
#[arg(short = 'p', long = "platform")]
|
||||
#[arg(short = 'p', long = "platform", help = "help.arg.platform")]
|
||||
pub platform: InternedString,
|
||||
#[arg(short = 'v', long = "version")]
|
||||
#[arg(short = 'v', long = "version", help = "help.arg.os-version")]
|
||||
pub version: Version,
|
||||
#[arg(help = "help.arg.asset-file-path")]
|
||||
pub file: PathBuf,
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +62,14 @@ pub fn version_api<C: Context>() -> ParentHandler<C> {
|
||||
#[ts(export)]
|
||||
pub struct AddVersionParams {
|
||||
#[ts(type = "string")]
|
||||
#[arg(help = "help.arg.os-version")]
|
||||
pub version: Version,
|
||||
#[arg(help = "help.arg.version-headline")]
|
||||
pub headline: String,
|
||||
#[arg(help = "help.arg.release-notes")]
|
||||
pub release_notes: String,
|
||||
#[ts(type = "string")]
|
||||
#[arg(help = "help.arg.source-version-range")]
|
||||
pub source_version: VersionRange,
|
||||
#[arg(skip)]
|
||||
#[ts(skip)]
|
||||
@@ -110,6 +114,7 @@ pub async fn add_version(
|
||||
#[ts(export)]
|
||||
pub struct RemoveVersionParams {
|
||||
#[ts(type = "string")]
|
||||
#[arg(help = "help.arg.os-version")]
|
||||
pub version: Version,
|
||||
}
|
||||
|
||||
@@ -135,15 +140,15 @@ pub async fn remove_version(
|
||||
#[ts(export)]
|
||||
pub struct GetOsVersionParams {
|
||||
#[ts(type = "string | null")]
|
||||
#[arg(long = "src")]
|
||||
#[arg(long = "src", help = "help.arg.source-version")]
|
||||
pub source_version: Option<Version>,
|
||||
#[ts(type = "string | null")]
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.target-version-range")]
|
||||
pub target_version: Option<VersionRange>,
|
||||
#[arg(long = "id")]
|
||||
#[arg(long = "id", help = "help.arg.server-id")]
|
||||
server_id: Option<String>,
|
||||
#[ts(type = "string | null")]
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.platform")]
|
||||
platform: Option<InternedString>,
|
||||
#[ts(skip)]
|
||||
#[arg(skip)]
|
||||
|
||||
@@ -123,10 +123,11 @@ pub async fn add_package(
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliAddPackageParams {
|
||||
#[arg(help = "help.arg.s9pk-file-path")]
|
||||
pub file: PathBuf,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.package-url")]
|
||||
pub url: Vec<Url>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.no-verify")]
|
||||
pub no_verify: bool,
|
||||
}
|
||||
|
||||
@@ -205,9 +206,11 @@ pub async fn cli_add_package(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct RemovePackageParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
#[arg(help = "help.arg.package-version")]
|
||||
pub version: VersionString,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.signature-hash")]
|
||||
pub sighash: Option<Base64<[u8; 32]>>,
|
||||
#[ts(skip)]
|
||||
#[arg(skip)]
|
||||
@@ -353,8 +356,11 @@ pub async fn add_mirror(
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliAddMirrorParams {
|
||||
#[arg(help = "help.arg.s9pk-file-path")]
|
||||
pub file: PathBuf,
|
||||
#[arg(help = "help.arg.mirror-url")]
|
||||
pub url: Url,
|
||||
#[arg(long, help = "help.arg.no-verify")]
|
||||
pub no_verify: bool,
|
||||
}
|
||||
|
||||
@@ -432,9 +438,11 @@ pub async fn cli_add_mirror(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct RemoveMirrorParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
#[arg(help = "help.arg.package-version")]
|
||||
pub version: VersionString,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.mirror-url")]
|
||||
#[ts(type = "string")]
|
||||
pub url: Url,
|
||||
#[ts(skip)]
|
||||
|
||||
@@ -51,17 +51,18 @@ pub struct PackageInfoShort {
|
||||
#[ts(export)]
|
||||
#[model = "Model<Self>"]
|
||||
pub struct GetPackageParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: Option<PackageId>,
|
||||
#[ts(type = "string | null")]
|
||||
#[arg(long, short = 'v')]
|
||||
#[arg(long, short = 'v', help = "help.arg.target-version-range")]
|
||||
pub target_version: Option<VersionRange>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.source-version")]
|
||||
pub source_version: Option<VersionString>,
|
||||
#[ts(skip)]
|
||||
#[arg(skip)]
|
||||
#[serde(rename = "__DeviceInfo_device_info")]
|
||||
pub device_info: Option<DeviceInfo>,
|
||||
#[arg(default_value = "none")]
|
||||
#[arg(default_value = "none", help = "help.arg.other-versions-detail")]
|
||||
pub other_versions: Option<PackageDetailLevel>,
|
||||
}
|
||||
|
||||
@@ -401,11 +402,12 @@ pub fn display_package_info(
|
||||
#[derive(Debug, Deserialize, Serialize, TS, Parser)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CliDownloadParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
#[arg(long, short = 'v')]
|
||||
#[arg(long, short = 'v', help = "help.arg.target-version-range")]
|
||||
#[ts(type = "string | null")]
|
||||
pub target_version: Option<VersionRange>,
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, help = "help.arg.destination-path")]
|
||||
pub dest: Option<PathBuf>,
|
||||
}
|
||||
|
||||
|
||||
@@ -51,9 +51,11 @@ pub fn signer_api<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct AddPackageSignerParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
#[arg(help = "help.arg.signer-id")]
|
||||
pub signer: Guid,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.version-range")]
|
||||
#[ts(type = "string | null")]
|
||||
pub versions: Option<VersionRange>,
|
||||
}
|
||||
@@ -93,7 +95,9 @@ pub async fn add_package_signer(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct RemovePackageSignerParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
#[arg(help = "help.arg.signer-id")]
|
||||
pub signer: Guid,
|
||||
}
|
||||
|
||||
@@ -130,6 +134,7 @@ pub async fn remove_package_signer(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct ListPackageSignersParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user