generated from pure_sagacity/rust-starter
added a little bit of the commands
This commit is contained in:
+30
-1
@@ -1,3 +1,32 @@
|
||||
use std::process;
|
||||
|
||||
use clap::Parser;
|
||||
use clap::crate_version;
|
||||
use cli::Cli;
|
||||
use colored::*;
|
||||
use git_version::git_version;
|
||||
|
||||
const GIT_VERSION: &str = git_version!();
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let cli = Cli::parse();
|
||||
|
||||
if cli.version {
|
||||
let top_msg = format!("Harbor version {}", crate_version!().green()).bright_blue();
|
||||
let bottom_msg =
|
||||
format!("An open source secrets management and distribution platform.").blue();
|
||||
let commit_msg = format!("Git commit {}", GIT_VERSION).dimmed();
|
||||
|
||||
println!("{}\n{}\n{}", top_msg, bottom_msg, commit_msg);
|
||||
process::exit(0);
|
||||
}
|
||||
|
||||
if cli.command.is_none() {
|
||||
println!(
|
||||
"{}\n{}",
|
||||
"No command was entered.".red(),
|
||||
"Exiting...".dimmed()
|
||||
);
|
||||
process::exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user