mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
help text for args
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -63,7 +63,9 @@ pub struct ActionInput {
|
||||
#[derive(Deserialize, Serialize, TS, Parser)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GetActionInputParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub package_id: PackageId,
|
||||
#[arg(help = "help.arg.action-id")]
|
||||
pub action_id: ActionId,
|
||||
}
|
||||
|
||||
@@ -280,8 +282,11 @@ pub struct RunActionParams {
|
||||
|
||||
#[derive(Parser)]
|
||||
struct CliRunActionParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub package_id: PackageId,
|
||||
#[arg(help = "help.arg.event-id")]
|
||||
pub event_id: Option<Guid>,
|
||||
#[arg(help = "help.arg.action-id")]
|
||||
pub action_id: ActionId,
|
||||
#[command(flatten)]
|
||||
pub input: StdinDeserializable<Option<Value>>,
|
||||
@@ -360,9 +365,11 @@ pub async fn run_action(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ClearTaskParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub package_id: PackageId,
|
||||
#[arg(help = "help.arg.replay-id")]
|
||||
pub replay_id: ReplayId,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.force-clear-task")]
|
||||
#[serde(default)]
|
||||
pub force: bool,
|
||||
}
|
||||
|
||||
@@ -421,6 +421,7 @@ impl AsLogoutSessionId for KillSessionId {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct KillParams {
|
||||
#[arg(help = "help.arg.session-ids")]
|
||||
ids: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -437,7 +438,9 @@ pub async fn kill<C: SessionAuthContext>(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ResetPasswordParams {
|
||||
#[arg(help = "help.arg.old-password")]
|
||||
old_password: Option<PasswordType>,
|
||||
#[arg(help = "help.arg.new-password")]
|
||||
new_password: Option<PasswordType>,
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,13 @@ use crate::version::VersionT;
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct BackupParams {
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
target_id: BackupTargetId,
|
||||
#[arg(long = "old-password")]
|
||||
#[arg(long = "old-password", help = "help.arg.old-backup-password")]
|
||||
old_password: Option<crate::auth::PasswordType>,
|
||||
#[arg(long = "package-ids")]
|
||||
#[arg(long = "package-ids", help = "help.arg.package-ids-to-backup")]
|
||||
package_ids: Option<Vec<PackageId>>,
|
||||
#[arg(help = "help.arg.backup-password")]
|
||||
password: crate::auth::PasswordType,
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,11 @@ use crate::{PLATFORM, PackageId};
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct RestorePackageParams {
|
||||
#[arg(help = "help.arg.package-ids")]
|
||||
pub ids: Vec<PackageId>,
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
pub target_id: BackupTargetId,
|
||||
#[arg(help = "help.arg.backup-password")]
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,13 @@ pub fn cifs<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct AddParams {
|
||||
#[arg(help = "help.arg.cifs-hostname")]
|
||||
pub hostname: String,
|
||||
#[arg(help = "help.arg.cifs-path")]
|
||||
pub path: PathBuf,
|
||||
#[arg(help = "help.arg.cifs-username")]
|
||||
pub username: String,
|
||||
#[arg(help = "help.arg.cifs-password")]
|
||||
pub password: Option<String>,
|
||||
}
|
||||
|
||||
@@ -130,10 +134,15 @@ pub async fn add(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UpdateParams {
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
pub id: BackupTargetId,
|
||||
#[arg(help = "help.arg.cifs-hostname")]
|
||||
pub hostname: String,
|
||||
#[arg(help = "help.arg.cifs-path")]
|
||||
pub path: PathBuf,
|
||||
#[arg(help = "help.arg.cifs-username")]
|
||||
pub username: String,
|
||||
#[arg(help = "help.arg.cifs-password")]
|
||||
pub password: Option<String>,
|
||||
}
|
||||
|
||||
@@ -195,6 +204,7 @@ pub async fn update(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct RemoveParams {
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
pub id: BackupTargetId,
|
||||
}
|
||||
|
||||
|
||||
@@ -268,8 +268,11 @@ fn display_backup_info(params: WithIoFormat<InfoParams>, info: BackupInfo) -> Re
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct InfoParams {
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
target_id: BackupTargetId,
|
||||
#[arg(help = "help.arg.server-id")]
|
||||
server_id: String,
|
||||
#[arg(help = "help.arg.backup-password")]
|
||||
password: String,
|
||||
}
|
||||
|
||||
@@ -305,11 +308,13 @@ lazy_static::lazy_static! {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct MountParams {
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
target_id: BackupTargetId,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.server-id")]
|
||||
server_id: Option<String>,
|
||||
#[arg(help = "help.arg.backup-password")]
|
||||
password: String, // TODO: rpassword
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.allow-partial-backup")]
|
||||
allow_partial: bool,
|
||||
}
|
||||
|
||||
@@ -385,6 +390,7 @@ pub async fn mount(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UmountParams {
|
||||
#[arg(help = "help.arg.backup-target-id")]
|
||||
target_id: Option<BackupTargetId>,
|
||||
}
|
||||
|
||||
|
||||
@@ -59,17 +59,25 @@ pub fn translate_cli(mut cmd: clap::Command) -> clap::Command {
|
||||
cmd = cmd.after_long_help(s);
|
||||
}
|
||||
|
||||
let args = cmd.get_arguments().cloned().collect::<Vec<_>>();
|
||||
for mut arg in args {
|
||||
if let Some(s) = arg.get_help() {
|
||||
let s = translate(s);
|
||||
arg = arg.help(s);
|
||||
}
|
||||
if let Some(s) = arg.get_long_help() {
|
||||
let s = translate(s);
|
||||
arg = arg.long_help(s);
|
||||
}
|
||||
cmd = cmd.arg(arg);
|
||||
let arg_ids = cmd
|
||||
.get_arguments()
|
||||
.map(|a| a.get_id().clone())
|
||||
.collect::<Vec<_>>();
|
||||
for id in arg_ids {
|
||||
cmd = cmd.mut_arg(id, |arg| {
|
||||
let arg = if let Some(s) = arg.get_help() {
|
||||
let s = translate(s);
|
||||
arg.help(s)
|
||||
} else {
|
||||
arg
|
||||
};
|
||||
if let Some(s) = arg.get_long_help() {
|
||||
let s = translate(s);
|
||||
arg.long_help(s)
|
||||
} else {
|
||||
arg
|
||||
}
|
||||
});
|
||||
}
|
||||
for cmd in cmd.get_subcommands_mut() {
|
||||
*cmd = translate_cli(cmd.clone());
|
||||
|
||||
@@ -58,27 +58,27 @@ pub trait ContextConfig: DeserializeOwned + Default {
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[command(version = crate::version::Current::default().semver().to_string())]
|
||||
pub struct ClientConfig {
|
||||
#[arg(short = 'c', long)]
|
||||
#[arg(short = 'c', long, help = "help.arg.config-file-path")]
|
||||
pub config: Option<PathBuf>,
|
||||
#[arg(short = 'H', long)]
|
||||
#[arg(short = 'H', long, help = "help.arg.host-url")]
|
||||
pub host: Option<Url>,
|
||||
#[arg(short = 'r', long)]
|
||||
#[arg(short = 'r', long, help = "help.arg.registry-url")]
|
||||
pub registry: Option<Url>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.registry-hostname")]
|
||||
pub registry_hostname: Option<Vec<InternedString>>,
|
||||
#[arg(skip)]
|
||||
pub registry_listen: Option<SocketAddr>,
|
||||
#[arg(short = 't', long)]
|
||||
#[arg(short = 't', long, help = "help.arg.tunnel-address")]
|
||||
pub tunnel: Option<SocketAddr>,
|
||||
#[arg(skip)]
|
||||
pub tunnel_listen: Option<SocketAddr>,
|
||||
#[arg(short = 'p', long)]
|
||||
#[arg(short = 'p', long, help = "help.arg.proxy-url")]
|
||||
pub proxy: Option<Url>,
|
||||
#[arg(skip)]
|
||||
pub socks_listen: Option<SocketAddr>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.cookie-path")]
|
||||
pub cookie_path: Option<PathBuf>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.developer-key-path")]
|
||||
pub developer_key_path: Option<PathBuf>,
|
||||
}
|
||||
impl ContextConfig for ClientConfig {
|
||||
@@ -109,19 +109,19 @@ impl ClientConfig {
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ServerConfig {
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, help = "help.arg.config-file-path")]
|
||||
pub config: Option<PathBuf>,
|
||||
#[arg(skip)]
|
||||
pub os_partitions: Option<OsPartitionInfo>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.socks-listen-address")]
|
||||
pub socks_listen: Option<SocketAddr>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.revision-cache-size")]
|
||||
pub revision_cache_size: Option<usize>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.disable-encryption")]
|
||||
pub disable_encryption: Option<bool>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.multi-arch-s9pks")]
|
||||
pub multi_arch_s9pks: Option<bool>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.developer-key-path")]
|
||||
pub developer_key_path: Option<PathBuf>,
|
||||
}
|
||||
impl ContextConfig for ServerConfig {
|
||||
|
||||
@@ -11,6 +11,7 @@ use crate::{Error, PackageId};
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ControlParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,10 @@ pub enum RevisionsRes {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliDumpParams {
|
||||
#[arg(long = "include-private", short = 'p')]
|
||||
#[arg(long = "include-private", short = 'p', help = "help.arg.include-private-data")]
|
||||
#[serde(default)]
|
||||
include_private: bool,
|
||||
#[arg(help = "help.arg.db-path")]
|
||||
path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -258,9 +259,11 @@ pub async fn subscribe(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliApplyParams {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.allow-model-mismatch")]
|
||||
allow_model_mismatch: bool,
|
||||
#[arg(help = "help.arg.db-apply-expr")]
|
||||
expr: String,
|
||||
#[arg(help = "help.arg.db-path")]
|
||||
path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -327,6 +330,7 @@ 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,
|
||||
}
|
||||
|
||||
@@ -366,8 +370,10 @@ pub fn put<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UiParams {
|
||||
#[arg(help = "help.arg.json-pointer")]
|
||||
#[ts(type = "string")]
|
||||
pointer: JsonPointer,
|
||||
#[arg(help = "help.arg.json-value")]
|
||||
#[ts(type = "any")]
|
||||
value: Value,
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@ pub async fn sideload(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CancelInstallParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
}
|
||||
|
||||
@@ -299,7 +300,9 @@ pub fn cancel_install(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct QueryPackageParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
id: PackageId,
|
||||
#[arg(help = "help.arg.version-range")]
|
||||
version: Option<VersionRange>,
|
||||
}
|
||||
|
||||
@@ -357,6 +360,7 @@ impl FromArgMatches for CliInstallParams {
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
#[ts(export)]
|
||||
pub struct InstalledVersionParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
id: PackageId,
|
||||
}
|
||||
|
||||
@@ -516,11 +520,12 @@ pub async fn cli_install(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UninstallParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
id: PackageId,
|
||||
#[arg(long, help = "Do not delete the service data")]
|
||||
#[arg(long, help = "help.arg.soft-uninstall")]
|
||||
#[serde(default)]
|
||||
soft: bool,
|
||||
#[arg(long, help = "Ignore errors in service uninit script")]
|
||||
#[arg(long, help = "help.arg.force-uninstall")]
|
||||
#[serde(default)]
|
||||
force: bool,
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ use crate::util::serde::{HandlerExtSerde, WithIoFormat, display_serializable};
|
||||
#[command(rename_all = "kebab-case")]
|
||||
#[ts(export)]
|
||||
pub struct EchoParams {
|
||||
#[arg(help = "help.arg.echo-message")]
|
||||
message: String,
|
||||
}
|
||||
|
||||
|
||||
@@ -232,6 +232,7 @@ pub const SYSTEM_UNIT: &str = "startd";
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct PackageIdParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
id: PackageId,
|
||||
}
|
||||
|
||||
@@ -327,14 +328,14 @@ pub struct LogsParams<Extra: FromArgMatches + Args = Empty> {
|
||||
#[command(flatten)]
|
||||
#[serde(flatten)]
|
||||
extra: Extra,
|
||||
#[arg(short = 'l', long = "limit")]
|
||||
#[arg(short = 'l', long = "limit", help = "help.arg.log-limit")]
|
||||
limit: Option<usize>,
|
||||
#[arg(short = 'c', long = "cursor", conflicts_with = "follow")]
|
||||
#[arg(short = 'c', long = "cursor", conflicts_with = "follow", help = "help.arg.log-cursor")]
|
||||
cursor: Option<String>,
|
||||
#[arg(short = 'b', long = "boot")]
|
||||
#[arg(short = 'b', long = "boot", help = "help.arg.log-boot")]
|
||||
#[serde(default)]
|
||||
boot: Option<BootIdentifier>,
|
||||
#[arg(short = 'B', long = "before", conflicts_with = "follow")]
|
||||
#[arg(short = 'B', long = "before", conflicts_with = "follow", help = "help.arg.log-before")]
|
||||
#[serde(default)]
|
||||
before: bool,
|
||||
}
|
||||
@@ -346,7 +347,7 @@ pub struct CliLogsParams<Extra: FromArgMatches + Args = Empty> {
|
||||
#[command(flatten)]
|
||||
#[serde(flatten)]
|
||||
rpc_params: LogsParams<Extra>,
|
||||
#[arg(short = 'f', long = "follow")]
|
||||
#[arg(short = 'f', long = "follow", help = "help.arg.log-follow")]
|
||||
#[serde(default)]
|
||||
follow: bool,
|
||||
}
|
||||
|
||||
@@ -463,9 +463,9 @@ impl ValueParserFactory for AcmeProvider {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct InitAcmeParams {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.acme-provider")]
|
||||
pub provider: AcmeProvider,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.acme-contact")]
|
||||
pub contact: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -488,7 +488,7 @@ pub async fn init(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct RemoveAcmeParams {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.acme-provider")]
|
||||
pub provider: AcmeProvider,
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ pub fn dns_api<C: Context>() -> ParentHandler<C> {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct QueryDnsParams {
|
||||
#[arg(help = "help.arg.fqdn")]
|
||||
pub fqdn: InternedString,
|
||||
}
|
||||
|
||||
@@ -134,6 +135,7 @@ pub fn query_dns<C: Context>(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct SetStaticDnsParams {
|
||||
#[arg(help = "help.arg.dns-servers")]
|
||||
pub servers: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,9 @@ async fn list_interfaces(
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
struct NetworkInterfaceSetPublicParams {
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
gateway: GatewayId,
|
||||
#[arg(help = "help.arg.is-public")]
|
||||
public: Option<bool>,
|
||||
}
|
||||
|
||||
@@ -156,6 +158,7 @@ async fn set_public(
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
struct UnsetPublicParams {
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
gateway: GatewayId,
|
||||
}
|
||||
|
||||
@@ -171,6 +174,7 @@ async fn unset_public(
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
struct ForgetGatewayParams {
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
gateway: GatewayId,
|
||||
}
|
||||
|
||||
@@ -183,7 +187,9 @@ async fn forget_iface(
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
struct RenameGatewayParams {
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
id: GatewayId,
|
||||
#[arg(help = "help.arg.gateway-name")]
|
||||
name: InternedString,
|
||||
}
|
||||
|
||||
|
||||
@@ -237,9 +237,11 @@ pub fn address_api<C: Context, Kind: HostApiKind>()
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct AddPublicDomainParams {
|
||||
#[arg(help = "help.arg.fqdn")]
|
||||
pub fqdn: InternedString,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.acme-provider")]
|
||||
pub acme: Option<AcmeProvider>,
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
pub gateway: GatewayId,
|
||||
}
|
||||
|
||||
@@ -284,6 +286,7 @@ pub async fn add_public_domain<Kind: HostApiKind>(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct RemoveDomainParams {
|
||||
#[arg(help = "help.arg.fqdn")]
|
||||
pub fqdn: InternedString,
|
||||
}
|
||||
|
||||
@@ -307,6 +310,7 @@ pub async fn remove_public_domain<Kind: HostApiKind>(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct AddPrivateDomainParams {
|
||||
#[arg(help = "help.arg.fqdn")]
|
||||
pub fqdn: InternedString,
|
||||
}
|
||||
|
||||
@@ -349,6 +353,7 @@ pub async fn remove_private_domain<Kind: HostApiKind>(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct OnionParams {
|
||||
#[arg(help = "help.arg.onion-address")]
|
||||
pub onion: String,
|
||||
}
|
||||
|
||||
|
||||
@@ -237,9 +237,11 @@ pub async fn list_bindings<Kind: HostApiKind>(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export)]
|
||||
pub struct BindingGatewaySetEnabledParams {
|
||||
#[arg(help = "help.arg.internal-port")]
|
||||
internal_port: u16,
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
gateway: GatewayId,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.binding-enabled")]
|
||||
enabled: Option<bool>,
|
||||
}
|
||||
|
||||
|
||||
@@ -166,11 +166,13 @@ impl Model<Host> {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct RequiresPackageId {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
package: PackageId,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct RequiresHostId {
|
||||
#[arg(help = "help.arg.host-id")]
|
||||
host: HostId,
|
||||
}
|
||||
|
||||
|
||||
@@ -289,6 +289,7 @@ pub async fn generate_key(ctx: RpcContext) -> Result<OnionAddress, Error> {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct AddKeyParams {
|
||||
#[arg(help = "help.arg.onion-secret-key")]
|
||||
pub key: Base64<[u8; 64]>,
|
||||
}
|
||||
|
||||
@@ -323,7 +324,7 @@ pub async fn list_keys(ctx: RpcContext) -> Result<BTreeSet<OnionAddress>, Error>
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ResetParams {
|
||||
#[arg(name = "wipe-state", short = 'w', long = "wipe-state")]
|
||||
#[arg(name = "wipe-state", short = 'w', long = "wipe-state", help = "help.arg.wipe-tor-state")]
|
||||
wipe_state: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -316,6 +316,7 @@ pub async fn generate_key(ctx: RpcContext) -> Result<OnionAddress, Error> {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct AddKeyParams {
|
||||
#[arg(help = "help.arg.onion-secret-key")]
|
||||
pub key: Base64<[u8; 64]>,
|
||||
}
|
||||
|
||||
@@ -350,8 +351,9 @@ pub async fn list_keys(ctx: RpcContext) -> Result<BTreeSet<OnionAddress>, Error>
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ResetParams {
|
||||
#[arg(name = "wipe-state", short = 'w', long = "wipe-state")]
|
||||
#[arg(name = "wipe-state", short = 'w', long = "wipe-state", help = "help.arg.wipe-tor-state")]
|
||||
wipe_state: bool,
|
||||
#[arg(help = "help.arg.reset-reason")]
|
||||
reason: String,
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,11 @@ pub fn tunnel_api<C: Context>() -> ParentHandler<C> {
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
#[ts(export)]
|
||||
pub struct AddTunnelParams {
|
||||
#[arg(help = "help.arg.tunnel-name")]
|
||||
name: InternedString,
|
||||
#[arg(help = "help.arg.wireguard-config")]
|
||||
config: String,
|
||||
#[arg(help = "help.arg.is-public")]
|
||||
public: bool,
|
||||
}
|
||||
|
||||
@@ -123,6 +126,7 @@ pub async fn add_tunnel(
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)]
|
||||
#[ts(export)]
|
||||
pub struct RemoveTunnelParams {
|
||||
#[arg(help = "help.arg.gateway-id")]
|
||||
id: GatewayId,
|
||||
}
|
||||
pub async fn remove_tunnel(
|
||||
|
||||
@@ -88,6 +88,7 @@ pub fn wifi<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct SetWifiEnabledParams {
|
||||
#[arg(help = "help.arg.wifi-enabled")]
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
@@ -152,7 +153,9 @@ pub fn country<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct AddParams {
|
||||
#[arg(help = "help.arg.wifi-ssid")]
|
||||
ssid: String,
|
||||
#[arg(help = "help.arg.wifi-password")]
|
||||
password: String,
|
||||
}
|
||||
#[instrument(skip_all)]
|
||||
@@ -229,6 +232,7 @@ pub async fn add(ctx: RpcContext, AddParams { ssid, password }: AddParams) -> Re
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct SsidParams {
|
||||
#[arg(help = "help.arg.wifi-ssid")]
|
||||
ssid: String,
|
||||
}
|
||||
|
||||
@@ -559,7 +563,7 @@ pub async fn get_available(ctx: RpcContext, _: Empty) -> Result<Vec<WifiListOut>
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct SetCountryParams {
|
||||
#[arg(value_parser = CountryCodeParser)]
|
||||
#[arg(value_parser = CountryCodeParser, help = "help.arg.wifi-country-code")]
|
||||
#[ts(type = "string")]
|
||||
country: CountryCode,
|
||||
}
|
||||
|
||||
@@ -78,8 +78,10 @@ pub fn notification<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ListNotificationParams {
|
||||
#[arg(help = "help.arg.notification-before-id")]
|
||||
#[ts(type = "number | null")]
|
||||
before: Option<u32>,
|
||||
#[arg(help = "help.arg.notification-limit")]
|
||||
#[ts(type = "number | null")]
|
||||
limit: Option<usize>,
|
||||
}
|
||||
@@ -141,6 +143,7 @@ pub async fn list(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ModifyNotificationParams {
|
||||
#[arg(help = "help.arg.notification-ids")]
|
||||
#[ts(type = "number[]")]
|
||||
ids: Vec<u32>,
|
||||
}
|
||||
@@ -175,6 +178,7 @@ pub async fn remove(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ModifyNotificationBeforeParams {
|
||||
#[arg(help = "help.arg.notification-before-id")]
|
||||
#[ts(type = "number")]
|
||||
before: u32,
|
||||
}
|
||||
@@ -296,9 +300,13 @@ pub async fn mark_unseen(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CreateParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
package: Option<PackageId>,
|
||||
#[arg(help = "help.arg.notification-level")]
|
||||
level: NotificationLevel,
|
||||
#[arg(help = "help.arg.notification-title")]
|
||||
title: String,
|
||||
#[arg(help = "help.arg.notification-message")]
|
||||
message: String,
|
||||
}
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ async fn get_block_device_size(path: impl AsRef<Path>) -> Result<u64, Error> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct InstallOsParams {
|
||||
#[arg(help = "help.arg.os-drive-path")]
|
||||
os_drive: PathBuf,
|
||||
#[command(flatten)]
|
||||
data_drive: Option<DataDrive>,
|
||||
@@ -115,9 +116,9 @@ pub struct InstallOsParams {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
struct DataDrive {
|
||||
#[arg(long = "data-drive")]
|
||||
#[arg(long = "data-drive", help = "help.arg.data-drive-path")]
|
||||
logicalname: PathBuf,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.wipe-drive")]
|
||||
wipe: bool,
|
||||
}
|
||||
|
||||
@@ -490,11 +491,11 @@ pub async fn install_os(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct CliInstallOsParams {
|
||||
#[arg(help = "Path to the squashfs image to install")]
|
||||
#[arg(help = "help.arg.squashfs-image-path")]
|
||||
squashfs: PathBuf,
|
||||
#[arg(help = "Target disk to install to (e.g., /dev/sda or /dev/loop0)")]
|
||||
#[arg(help = "help.arg.target-disk")]
|
||||
disk: PathBuf,
|
||||
#[arg(long, help = "Use EFI boot (default: true for GPT disks)")]
|
||||
#[arg(long, help = "help.arg.use-efi-boot")]
|
||||
efi: Option<bool>,
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ pub fn s9pk() -> ParentHandler<CliContext> {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
struct S9pkPath {
|
||||
#[arg(help = "help.arg.s9pk-file-path")]
|
||||
s9pk: PathBuf,
|
||||
}
|
||||
|
||||
@@ -115,6 +116,7 @@ fn inspect() -> ParentHandler<CliContext, S9pkPath> {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
struct AddImageParams {
|
||||
#[arg(help = "help.arg.image-id")]
|
||||
id: ImageId,
|
||||
#[command(flatten)]
|
||||
config: ImageConfig,
|
||||
@@ -148,6 +150,7 @@ async fn add_image(
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
struct EditManifestParams {
|
||||
#[arg(help = "help.arg.db-apply-expr")]
|
||||
expression: String,
|
||||
}
|
||||
async fn edit_manifest(
|
||||
@@ -194,6 +197,7 @@ async fn file_tree(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
struct CatParams {
|
||||
#[arg(help = "help.arg.file-path")]
|
||||
file_path: PathBuf,
|
||||
}
|
||||
async fn cat(
|
||||
|
||||
@@ -16,5 +16,6 @@ pub const SIG_CONTEXT: &[u8] = b"s9pk";
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct VerifyParams {
|
||||
#[arg(help = "help.arg.s9pk-file-path")]
|
||||
pub path: PathBuf,
|
||||
}
|
||||
|
||||
@@ -155,20 +155,21 @@ impl From<PackSource> for DynFileSource {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct PackParams {
|
||||
#[arg(help = "help.arg.input-path")]
|
||||
pub path: Option<PathBuf>,
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, help = "help.arg.output-path")]
|
||||
pub output: Option<PathBuf>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.javascript-path")]
|
||||
pub javascript: Option<PathBuf>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.icon-path")]
|
||||
pub icon: Option<PathBuf>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.license-path")]
|
||||
pub license: Option<PathBuf>,
|
||||
#[arg(long, conflicts_with = "no-assets")]
|
||||
#[arg(long, conflicts_with = "no-assets", help = "help.arg.assets-path")]
|
||||
pub assets: Option<PathBuf>,
|
||||
#[arg(long, conflicts_with = "assets")]
|
||||
#[arg(long, conflicts_with = "assets", help = "help.arg.no-assets")]
|
||||
pub no_assets: bool,
|
||||
#[arg(long, help = "Architecture Mask")]
|
||||
#[arg(long, help = "help.arg.architecture-mask")]
|
||||
pub arch: Vec<InternedString>,
|
||||
}
|
||||
impl PackParams {
|
||||
@@ -280,19 +281,19 @@ pub struct ImageConfig {
|
||||
|
||||
#[derive(Parser)]
|
||||
struct CliImageConfig {
|
||||
#[arg(long, conflicts_with("docker-tag"))]
|
||||
#[arg(long, conflicts_with("docker-tag"), help = "help.arg.docker-build")]
|
||||
docker_build: bool,
|
||||
#[arg(long, requires("docker-build"))]
|
||||
#[arg(long, requires("docker-build"), help = "help.arg.dockerfile-path")]
|
||||
dockerfile: Option<PathBuf>,
|
||||
#[arg(long, requires("docker-build"))]
|
||||
#[arg(long, requires("docker-build"), help = "help.arg.workdir-path")]
|
||||
workdir: Option<PathBuf>,
|
||||
#[arg(long, conflicts_with_all(["dockerfile", "workdir"]))]
|
||||
#[arg(long, conflicts_with_all(["dockerfile", "workdir"]), help = "help.arg.docker-tag")]
|
||||
docker_tag: Option<String>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.architecture-mask")]
|
||||
arch: Vec<InternedString>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.emulate-missing-arch")]
|
||||
emulate_missing_as: Option<InternedString>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.nvidia-container")]
|
||||
nvidia_container: bool,
|
||||
}
|
||||
impl TryFrom<CliImageConfig> for ImageConfig {
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::service::effects::context::EffectContext;
|
||||
|
||||
#[derive(Debug, Default, Parser)]
|
||||
pub struct ContainerClientConfig {
|
||||
#[arg(long = "socket")]
|
||||
#[arg(long = "socket", help = "help.arg.socket-path")]
|
||||
pub socket: Option<PathBuf>,
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ pub async fn export_action(
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ClearActionsParams {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.except-actions")]
|
||||
pub except: Vec<ActionId>,
|
||||
}
|
||||
|
||||
@@ -118,7 +118,9 @@ pub struct GetActionInputParams {
|
||||
#[arg(skip)]
|
||||
procedure_id: Guid,
|
||||
#[ts(optional)]
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
package_id: Option<PackageId>,
|
||||
#[arg(help = "help.arg.action-id")]
|
||||
action_id: ActionId,
|
||||
}
|
||||
async fn get_action_input(
|
||||
@@ -156,9 +158,12 @@ pub struct RunActionParams {
|
||||
#[arg(skip)]
|
||||
procedure_id: Guid,
|
||||
#[ts(optional)]
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
package_id: Option<PackageId>,
|
||||
#[arg(help = "help.arg.action-id")]
|
||||
action_id: ActionId,
|
||||
#[ts(type = "any")]
|
||||
#[arg(help = "help.arg.action-input")]
|
||||
input: Value,
|
||||
}
|
||||
async fn run_action(
|
||||
@@ -285,9 +290,9 @@ async fn create_task(
|
||||
#[ts(type = "{ only: string[] } | { except: string[] }")]
|
||||
#[ts(export)]
|
||||
pub struct ClearTasksParams {
|
||||
#[arg(long, conflicts_with = "except")]
|
||||
#[arg(long, conflicts_with = "except", help = "help.arg.only-tasks")]
|
||||
pub only: Option<Vec<ReplayId>>,
|
||||
#[arg(long, conflicts_with = "only")]
|
||||
#[arg(long, conflicts_with = "only", help = "help.arg.except-tasks")]
|
||||
pub except: Option<Vec<ReplayId>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -319,9 +319,9 @@ impl CallbackHandlers {
|
||||
#[ts(type = "{ only: number[] } | { except: number[] }")]
|
||||
#[ts(export)]
|
||||
pub struct ClearCallbacksParams {
|
||||
#[arg(long, conflicts_with = "except")]
|
||||
#[arg(long, conflicts_with = "except", help = "help.arg.only-callbacks")]
|
||||
pub only: Option<Vec<CallbackId>>,
|
||||
#[arg(long, conflicts_with = "only")]
|
||||
#[arg(long, conflicts_with = "only", help = "help.arg.except-callbacks")]
|
||||
pub except: Option<Vec<CallbackId>>,
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ pub(super) use crate::service::effects::context::EffectContext;
|
||||
#[ts(export)]
|
||||
pub struct EventId {
|
||||
#[serde(default)]
|
||||
#[arg(default_value_t, long)]
|
||||
#[arg(default_value_t, long, help = "help.arg.event-id")]
|
||||
pub event_id: Guid,
|
||||
}
|
||||
|
||||
@@ -107,22 +107,23 @@ fn open_file_read(path: impl AsRef<Path>) -> Result<File, Error> {
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Parser)]
|
||||
pub struct ExecParams {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.force-tty")]
|
||||
force_tty: bool,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.force-stderr-tty")]
|
||||
force_stderr_tty: bool,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.pty-size")]
|
||||
pty_size: Option<TermSize>,
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, help = "help.arg.env-variable")]
|
||||
env: Vec<String>,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.env-file-path")]
|
||||
env_file: Option<PathBuf>,
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, help = "help.arg.workdir-path")]
|
||||
workdir: Option<PathBuf>,
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, help = "help.arg.user-name")]
|
||||
user: Option<String>,
|
||||
#[arg(help = "help.arg.chroot-path")]
|
||||
chroot: PathBuf,
|
||||
#[arg(trailing_var_arg = true)]
|
||||
#[arg(trailing_var_arg = true, help = "help.arg.command-to-execute")]
|
||||
command: Vec<OsString>,
|
||||
}
|
||||
impl ExecParams {
|
||||
|
||||
@@ -685,6 +685,7 @@ struct ServiceActorSeed {
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser, TS)]
|
||||
pub struct RebuildParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
}
|
||||
pub async fn rebuild(ctx: RpcContext, RebuildParams { id }: RebuildParams) -> Result<(), Error> {
|
||||
@@ -1134,18 +1135,19 @@ async fn get_passwd_command(etc_passwd_path: PathBuf, user: &str) -> RootCommand
|
||||
|
||||
#[derive(Deserialize, Serialize, Parser)]
|
||||
pub struct CliAttachParams {
|
||||
#[arg(help = "help.arg.package-id")]
|
||||
pub id: PackageId,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.force-tty")]
|
||||
pub force_tty: bool,
|
||||
#[arg(trailing_var_arg = true)]
|
||||
#[arg(trailing_var_arg = true, help = "help.arg.command-to-execute")]
|
||||
pub command: Vec<OsString>,
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, help = "help.arg.subcontainer-name")]
|
||||
subcontainer: Option<InternedString>,
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, help = "help.arg.container-name")]
|
||||
name: Option<InternedString>,
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, help = "help.arg.user-name")]
|
||||
user: Option<InternedString>,
|
||||
#[arg(long, short)]
|
||||
#[arg(long, short, help = "help.arg.image-id")]
|
||||
image_id: Option<ImageId>,
|
||||
}
|
||||
#[instrument[skip_all]]
|
||||
|
||||
@@ -118,6 +118,7 @@ pub fn ssh<C: Context>() -> ParentHandler<C> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct AddParams {
|
||||
#[arg(help = "help.arg.ssh-public-key")]
|
||||
key: SshPubKey,
|
||||
}
|
||||
|
||||
@@ -152,6 +153,7 @@ pub async fn add(ctx: RpcContext, AddParams { key }: AddParams) -> Result<SshKey
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct DeleteParams {
|
||||
#[arg(help = "help.arg.ssh-fingerprint")]
|
||||
#[ts(type = "string")]
|
||||
fingerprint: InternedString,
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ pub async fn enable_zram() -> Result<(), Error> {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct ZramParams {
|
||||
#[arg(help = "help.arg.enable-zram")]
|
||||
enable: bool,
|
||||
}
|
||||
|
||||
@@ -148,6 +149,7 @@ fn display_governor_info(
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct GovernorParams {
|
||||
#[arg(help = "help.arg.governor-name")]
|
||||
set: Option<Governor>,
|
||||
}
|
||||
|
||||
@@ -1043,15 +1045,15 @@ async fn get_disk_info() -> Result<MetricsDisk, Error> {
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SmtpValue {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-server")]
|
||||
pub server: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-port")]
|
||||
pub port: u16,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-from")]
|
||||
pub from: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-login")]
|
||||
pub login: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-password")]
|
||||
pub password: Option<String>,
|
||||
}
|
||||
pub async fn set_system_smtp(ctx: RpcContext, smtp: SmtpValue) -> Result<(), Error> {
|
||||
@@ -1089,17 +1091,17 @@ pub async fn clear_system_smtp(ctx: RpcContext) -> Result<(), Error> {
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TestSmtpParams {
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-server")]
|
||||
pub server: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-port")]
|
||||
pub port: u16,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-from")]
|
||||
pub from: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-to")]
|
||||
pub to: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-login")]
|
||||
pub login: String,
|
||||
#[arg(long)]
|
||||
#[arg(long, help = "help.arg.smtp-password")]
|
||||
pub password: String,
|
||||
}
|
||||
pub async fn test_smtp(
|
||||
@@ -1136,10 +1138,13 @@ pub async fn test_smtp(
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, TS, Parser)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KeyboardOptions {
|
||||
#[arg(help = "help.arg.keyboard-layout")]
|
||||
pub layout: InternedString,
|
||||
#[arg(long, help = "help.arg.keyboard-model")]
|
||||
pub model: Option<InternedString>,
|
||||
#[arg(long, help = "help.arg.keyboard-variant")]
|
||||
pub variant: Option<InternedString>,
|
||||
#[arg(short, long = "option")]
|
||||
#[arg(short, long = "option", help = "help.arg.keyboard-option")]
|
||||
#[serde(default)]
|
||||
pub options: Vec<InternedString>,
|
||||
}
|
||||
@@ -1194,6 +1199,7 @@ pub async fn set_keyboard(ctx: RpcContext, options: KeyboardOptions) -> Result<(
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, TS, Parser)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetLanguageParams {
|
||||
#[arg(help = "help.arg.language-code")]
|
||||
pub language: InternedString,
|
||||
}
|
||||
|
||||
|
||||
@@ -43,11 +43,11 @@ use crate::util::sync::{SyncMutex, Watch};
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct TunnelConfig {
|
||||
#[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.tunnel-listen-address")]
|
||||
pub tunnel_listen: Option<SocketAddr>,
|
||||
#[arg(short = 'd', long = "datadir")]
|
||||
#[arg(short = 'd', long = "datadir", help = "help.arg.data-directory")]
|
||||
pub datadir: Option<PathBuf>,
|
||||
}
|
||||
impl ContextConfig for TunnelConfig {
|
||||
@@ -244,6 +244,7 @@ impl Deref for TunnelContext {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Parser)]
|
||||
pub struct TunnelAddrParams {
|
||||
#[arg(help = "help.arg.tunnel-ip-address")]
|
||||
pub tunnel: IpAddr,
|
||||
}
|
||||
|
||||
@@ -310,6 +311,7 @@ impl CallRemote<TunnelContext> for CliContext {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Parser)]
|
||||
pub struct TunnelUrlParams {
|
||||
#[arg(help = "help.arg.tunnel-url")]
|
||||
pub tunnel: Url,
|
||||
}
|
||||
|
||||
|
||||
@@ -121,8 +121,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.json-pointer")]
|
||||
pointer: Option<JsonPointer>,
|
||||
#[arg(help = "help.arg.database-path")]
|
||||
path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
@@ -154,7 +155,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.json-pointer")]
|
||||
#[ts(type = "string | null")]
|
||||
pointer: Option<JsonPointer>,
|
||||
}
|
||||
@@ -170,7 +171,9 @@ pub async fn dump(ctx: TunnelContext, DumpParams { pointer }: DumpParams) -> Res
|
||||
#[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>,
|
||||
}
|
||||
|
||||
@@ -225,7 +228,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>,
|
||||
}
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ pub async fn import_certificate_cli(
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Parser)]
|
||||
pub struct GenerateCertParams {
|
||||
#[arg(help = "Subject Alternative Name(s)")]
|
||||
#[arg(help = "help.arg.cert-subject-alt-names")]
|
||||
pub subject: Vec<InternedString>,
|
||||
}
|
||||
|
||||
@@ -331,6 +331,7 @@ pub async fn get_certificate(ctx: TunnelContext) -> Result<Option<Pem<Vec<X509>>
|
||||
#[derive(Debug, Deserialize, Serialize, Parser)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SetListenParams {
|
||||
#[arg(help = "help.arg.listen-address")]
|
||||
pub listen: SocketAddr,
|
||||
}
|
||||
|
||||
|
||||
@@ -42,12 +42,13 @@ use crate::util::io::AtomicFile;
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[command(rename_all = "kebab-case")]
|
||||
pub struct UpdateSystemParams {
|
||||
#[arg(help = "help.arg.registry-url")]
|
||||
#[ts(type = "string")]
|
||||
registry: Url,
|
||||
#[ts(type = "string | null")]
|
||||
#[arg(long = "to")]
|
||||
#[arg(long = "to", help = "help.arg.update-target-version")]
|
||||
target: Option<VersionRange>,
|
||||
#[arg(long = "no-progress", action = ArgAction::SetFalse)]
|
||||
#[arg(long = "no-progress", action = ArgAction::SetFalse, help = "help.arg.no-progress")]
|
||||
#[serde(default)]
|
||||
progress: bool,
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ pub fn util<C: Context>() -> ParentHandler<C> {
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Parser)]
|
||||
pub struct B3sumParams {
|
||||
#[arg(long = "no-mmap", action = clap::ArgAction::SetFalse)]
|
||||
#[arg(long = "no-mmap", action = clap::ArgAction::SetFalse, help = "help.arg.no-mmap")]
|
||||
allow_mmap: bool,
|
||||
file: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user