1
0
mirror of https://github.com/jht5945/buildj.git synced 2025-12-27 17:20:06 +08:00

add print_version

This commit is contained in:
2019-08-11 12:01:51 +08:00
parent 86b7b85776
commit b6933ff3b8
2 changed files with 12 additions and 0 deletions

View File

@@ -124,6 +124,8 @@ fn do_with_buildin_args(args: &Vec<String>) {
let first_arg = args.get(1).unwrap();
if first_arg == ":::" || first_arg == ":::help" {
print_usage();
} else if first_arg == ":::version" {
print_version();
} else if first_arg == ":::create" {
create_build_json(&args);
} else if first_arg.starts_with(":::java") {

View File

@@ -9,6 +9,7 @@ pub fn print_usage() {
print!(r#"
buildj ::: - print this message
buildj :::help - print this message
buildj :::version - print version
buildj :::create --java<version> --maven<version> - create java + maven project
e.g. buildj :::create --java1.8 --maven3.5.2
buildj :::create --java<version> --gradle<version> - create java + gradle project
@@ -23,6 +24,15 @@ buildj - run build, run assigned v
"#);
}
pub fn print_version() {
print!(r#"buildj {} - {}
Copyright (C) 2019 Hatter Jiang.
License MIT <https://opensource.org/licenses/MIT>
Written by Hatter Jiang
"#, super::BUDERJ_VER, &super::GIT_HASH[0..7]);
}
pub fn is_verbose() -> bool {
match env::var("BUILDJ_VERBOSE") {
Err(_) => false,