2022-08-28 21:13:21 +03:00
|
|
|
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
|
2021-12-09 18:21:33 +03:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
use crate::Result;
|
2022-02-27 23:35:43 +03:00
|
|
|
use clap::{Parser, Subcommand};
|
2021-12-09 18:21:33 +03:00
|
|
|
|
|
|
|
mod generate;
|
|
|
|
mod sign;
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
2022-02-27 23:35:43 +03:00
|
|
|
#[clap(
|
|
|
|
author,
|
|
|
|
version,
|
|
|
|
about = "Tauri updater signer",
|
|
|
|
subcommand_required(true),
|
|
|
|
arg_required_else_help(true)
|
|
|
|
)]
|
2021-12-09 18:21:33 +03:00
|
|
|
pub struct Cli {
|
|
|
|
#[clap(subcommand)]
|
|
|
|
command: Commands,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
|
|
enum Commands {
|
|
|
|
Sign(sign::Options),
|
|
|
|
Generate(generate::Options),
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn command(cli: Cli) -> Result<()> {
|
|
|
|
match cli.command {
|
|
|
|
Commands::Sign(options) => sign::command(options)?,
|
|
|
|
Commands::Generate(options) => generate::command(options)?,
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
}
|