For now this is just a simple implementation only supporting `put` steps. `in` is a noop, so `no_get: true` is recommended.
56 lines
1.1 KiB
Rust
56 lines
1.1 KiB
Rust
use std::path::PathBuf;
|
|
|
|
use clap::{Parser, Subcommand};
|
|
use color_eyre::Result;
|
|
|
|
static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
|
|
|
|
#[derive(Debug, Parser)]
|
|
#[command(author, version, about, long_about = None)]
|
|
#[command(propagate_version = true)]
|
|
struct Cli {
|
|
#[command(subcommand)]
|
|
command: Commands,
|
|
}
|
|
|
|
#[derive(Clone, Debug, Subcommand)]
|
|
enum Commands {
|
|
Pr {
|
|
#[command(subcommand)]
|
|
action: Action,
|
|
},
|
|
Package {
|
|
#[command(subcommand)]
|
|
action: Action,
|
|
},
|
|
Status {
|
|
#[command(subcommand)]
|
|
action: Action,
|
|
},
|
|
}
|
|
|
|
#[derive(Clone, Debug, Subcommand)]
|
|
pub(crate) enum Action {
|
|
Check,
|
|
In { dest: PathBuf },
|
|
Out { src: PathBuf },
|
|
}
|
|
|
|
mod types;
|
|
mod util;
|
|
mod cmd {
|
|
pub mod package;
|
|
pub mod pr;
|
|
pub mod status;
|
|
}
|
|
|
|
fn main() -> Result<()> {
|
|
color_eyre::install()?;
|
|
let cli = Cli::parse();
|
|
|
|
match &cli.command {
|
|
Commands::Pr { action } => cmd::pr::run(action),
|
|
Commands::Package { action } => cmd::package::run(action),
|
|
Commands::Status { action } => cmd::status::run(action),
|
|
}
|
|
}
|