-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Omit 'packetcrypt-' when printing version
- Loading branch information
Showing
1 changed file
with
9 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,18 +267,20 @@ async fn async_main(matches: clap::ArgMatches<'_>) -> Result<()> { | |
Ok(()) | ||
} | ||
|
||
// const fn version() -> &'static str { | ||
// let v = git_version::git_version!(); | ||
// if v == | ||
// git_version::git_version!(args = ["--tags"]); | ||
// &"hi" | ||
// } | ||
fn version() -> &'static str { | ||
let out = git_version::git_version!(args = ["--tags", "--dirty=-dirty"]); | ||
if out.starts_with("packetcrypt-") { | ||
&out["packetcrypt-".len()..] | ||
} else { | ||
&out | ||
} | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
let cpus_str = format!("{}", num_cpus::get()); | ||
let matches = App::new("packetcrypt") | ||
.version(git_version::git_version!(args = ["--tags", "--dirty=-dirty"])) | ||
.version(version()) | ||
.author("Caleb James DeLisle <[email protected]>") | ||
.about("Bandwidth hard proof of work algorithm") | ||
.setting(clap::AppSettings::ArgRequiredElseHelp) | ||
|