summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-11-10 11:28:10 -0500
committertylermurphy534 <tylermurphy534@gmail.com>2022-11-10 11:28:10 -0500
commitf7a13253e72f1dde7389fb98c090b753fdfc42b9 (patch)
treeb2433e907a78636363dc042be77aa8492c45f656 /src/main.rs
parentupdate aur depends (diff)
downloadcrab-f7a13253e72f1dde7389fb98c090b753fdfc42b9.tar.gz
crab-f7a13253e72f1dde7389fb98c090b753fdfc42b9.tar.bz2
crab-f7a13253e72f1dde7389fb98c090b753fdfc42b9.zip
slight refactor
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 28f08cd..51ca0f2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -14,7 +14,6 @@ const ERROR_RUN_ROOT: u8 = 6;
mod persist;
mod flags;
-mod help;
mod secure;
fn main() -> ExitCode {
@@ -22,7 +21,7 @@ fn main() -> ExitCode {
let flags = match flags::parse(&args[1..]) {
Some(data) => data,
None => {
- help::help();
+ help();
return ExitCode::from(ERROR_ARGS);
}
};
@@ -31,7 +30,7 @@ fn main() -> ExitCode {
return ExitCode::SUCCESS;
}
if flags.help {
- help::help();
+ help();
return ExitCode::SUCCESS;
}
if args.len() - flags.arg_count < 2 {
@@ -74,6 +73,17 @@ fn main() -> ExitCode {
ExitCode::SUCCESS
}
+fn help() {
+ let help =
+"Usage:
+ crab [-d] command [args]
+Options:
+ -v --version Get the current version of the package
+ -h --help Generates the crab help message
+ -d If your user is set to persist, dont save persistance";
+ println!("{}", help);
+}
+
struct Config {
users: Vec<(String, bool)>
}