Skip to content

Commit

Permalink
feat: do not use verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai committed Oct 25, 2023
1 parent 66ad61d commit 6e7a9fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
22 changes: 8 additions & 14 deletions crates/fluvio-version-manager/src/command/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@ use sysinfo::SystemExt;
use crate::{BINARY_NAME, BINARY_VERSION};

#[derive(Debug, Args)]
pub struct VersionOpt {
#[clap(long, help = "Print extra binary information")]
verbose: bool,
}
pub struct VersionOpt;

impl VersionOpt {
pub fn process(self) -> Result<()> {
println!("{BINARY_NAME} {BINARY_VERSION}");

if self.verbose {
println!("arch: {CURRENT_PLATFORM}");
println!("{BINARY_NAME} CLI: {BINARY_VERSION}");
println!("{BINARY_NAME} CLI Arch: {CURRENT_PLATFORM}");

if let Some(sha) = self.format_cli_sha() {
println!("checksum (sha256): {}", sha);
}
if let Some(sha) = self.format_cli_sha() {
println!("{BINARY_NAME} CLI SHA256: {}", sha);
}

if let Some(info) = os_info() {
println!("OS Details: {info}");
}
if let Some(info) = os_info() {
println!("OS Details: {info}");
}

Ok(())
Expand Down
12 changes: 4 additions & 8 deletions tests/cli/fvm_smoke_tests/fvm_basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -648,21 +648,17 @@ setup_file() {
assert_success
}

@test "Prints version with and without details on fvm version" {
@test "Prints version with details on fvm version" {
run bash -c '$FVM_BIN self install'
assert_success

# Sets `fvm` in the PATH using the "env" file included in the installation
source ~/.fvm/env

run bash -c 'fvm version'
assert_line --index 0 "fvm $FVM_CARGO_TOML_VERSION"
assert_success

run bash -c 'fvm version --verbose'
assert_line --index 0 "fvm $FVM_CARGO_TOML_VERSION"
assert_line --index 1 --partial "arch: "
assert_line --index 2 --partial "checksum (sha256): "
assert_line --index 0 "fvm CLI: $FVM_CARGO_TOML_VERSION"
assert_line --index 1 --partial "fvm CLI Arch: "
assert_line --index 2 --partial "fvm CLI SHA256: "
assert_line --index 3 --partial "OS Details: "
assert_success

Expand Down

0 comments on commit 6e7a9fa

Please sign in to comment.