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