Skip to content

Commit

Permalink
add --version command line argument
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jan 22, 2024
1 parent a05f5f6 commit 73edcf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo dpkg -i "${{ steps.package_debian.outputs.file_path }}"
kaspa-ng --help || echo "Failed to execute kaspa-ng --help"
kaspa-ng --version || echo "Failed to execute kaspa-ng --version"
- name: Upload release asset
uses: actions/upload-release-asset@v1
Expand Down
6 changes: 5 additions & 1 deletion core/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ cfg_if! {
let cmd = Command::new("kaspa-ng")

.about(format!("kaspa-ng v{VERSION}-{GIT_DESCRIBE} (rusty-kaspa v{})", kaspa_wallet_core::version()))
.arg(arg!(--version "Display software version"))
.arg(arg!(--disable "Disable node services when starting"))
.arg(arg!(--daemon "Run as Rusty Kaspa p2p daemon"))
.arg(arg!(--cli "Run as Rusty Kaspa Cli Wallet"))
Expand Down Expand Up @@ -109,7 +110,10 @@ cfg_if! {

let matches = cmd.get_matches();

if matches.get_one::<bool>("cli").cloned().unwrap_or(false) {
if matches.get_one::<bool>("version").cloned().unwrap_or(false) {
println!("v{VERSION}-{GIT_DESCRIBE}");
std::process::exit(0);
} else if matches.get_one::<bool>("cli").cloned().unwrap_or(false) {
Args::Cli
} else if let Some(matches) = matches.subcommand_matches("i18n") {
if let Some(_matches) = matches.subcommand_matches("import") {
Expand Down

0 comments on commit 73edcf9

Please sign in to comment.