|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
use clap::{App, AppSettings, Arg, ArgMatches, ArgSettings, Shell, SubCommand};
|
|
|
|
|
use clap::{App, Arg, SubCommand};
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let app = App::new("jade")
|
|
|
|
@ -115,6 +115,48 @@ fn main() {
|
|
|
|
|
.required(true),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
.get_matches();
|
|
|
|
|
).get_matches();
|
|
|
|
|
|
|
|
|
|
if let Some(app) = app.subcommand_matches("set") {
|
|
|
|
|
if let Some(app) = app.subcommand_matches("partition") {
|
|
|
|
|
let mode = app.value_of("mode").unwrap();
|
|
|
|
|
let root = app.value_of("root").unwrap_or("none");
|
|
|
|
|
let boot = app.value_of("boot").unwrap_or("none");
|
|
|
|
|
let swap = app.value_of("swap").unwrap_or("none");
|
|
|
|
|
println!("mode: {}", mode);
|
|
|
|
|
println!("root: {}", root);
|
|
|
|
|
println!("boot: {}", boot);
|
|
|
|
|
println!("swap: {}", swap);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("timezone") {
|
|
|
|
|
let timezone = app.value_of("timezone").unwrap();
|
|
|
|
|
println!("{}", timezone);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("locales") {
|
|
|
|
|
let locales = app.values_of("locales").unwrap();
|
|
|
|
|
println!("{:?}", locales);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("hostname") {
|
|
|
|
|
let hostname = app.value_of("hostname").unwrap();
|
|
|
|
|
println!("{}", hostname);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("ipv6") {
|
|
|
|
|
let ipv6 = app.value_of("ipv6").unwrap();
|
|
|
|
|
println!("{}", ipv6);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("rootPass") {
|
|
|
|
|
let root_pass = app.value_of("rootPass").unwrap();
|
|
|
|
|
println!("{}", root_pass);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("newUser") {
|
|
|
|
|
let username = app.value_of("username").unwrap();
|
|
|
|
|
let password = app.value_of("password").unwrap();
|
|
|
|
|
println!("{}", username);
|
|
|
|
|
println!("{}", password);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("graphical") {
|
|
|
|
|
let de = app.value_of("de").unwrap();
|
|
|
|
|
let dm = app.value_of("dm").unwrap();
|
|
|
|
|
println!("{}", de);
|
|
|
|
|
println!("{}", dm);
|
|
|
|
|
} else if let Some(app) = app.subcommand_matches("flatpak") {
|
|
|
|
|
let flatpak = app.value_of("flatpak").unwrap();
|
|
|
|
|
println!("{}", flatpak);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
println!("Running TUI installer");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|