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