mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 18:30:43 -06:00
make subcommand required
This commit is contained in:
parent
c27b4dde70
commit
1065433ba5
1 changed files with 8 additions and 12 deletions
|
@ -21,7 +21,7 @@ struct Cli {
|
||||||
no_pinix: bool,
|
no_pinix: bool,
|
||||||
|
|
||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
command: Option<Commands>,
|
command: Commands,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Subcommand)]
|
#[derive(Debug, Subcommand)]
|
||||||
|
@ -155,8 +155,7 @@ fn main() {
|
||||||
println!("{:?}", oizys)
|
println!("{:?}", oizys)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(command) = &cli.command {
|
match &cli.command {
|
||||||
match command {
|
|
||||||
Commands::Dry {} => oizys.build(true),
|
Commands::Dry {} => oizys.build(true),
|
||||||
Commands::Build {} => oizys.build(false),
|
Commands::Build {} => oizys.build(false),
|
||||||
Commands::Path {} => println!("{}", oizys.output()),
|
Commands::Path {} => println!("{}", oizys.output()),
|
||||||
|
@ -164,7 +163,4 @@ fn main() {
|
||||||
Commands::Switch {} => oizys.nixos_rebuild("switch"),
|
Commands::Switch {} => oizys.nixos_rebuild("switch"),
|
||||||
Commands::Cache { name } => oizys.cache(name),
|
Commands::Cache { name } => oizys.cache(name),
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
println!("No command given")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue