Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/cli/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,21 @@ struct EnvArgs {
/// Print output in JSON format
#[arg(long)]
json: bool,

/// Use verbose output
#[arg(short = 'v', long = "verbose", action = clap::ArgAction::Count)]
_verbose: u8,

/// Do not print status output
#[arg(short = 'q', long = "quiet")]
_quiet: bool,
}

pub fn run(args: Vec<String>) -> anyhow::Result<()> {
let (mut shell, args) = init(args)?;
let args = EnvArgs::try_parse_from(args)?;

let (ndk_home, _ndk_detection_method) = match derive_ndk_path(&mut shell) {
let (ndk_home, ndk_detection_method) = match derive_ndk_path(&mut shell) {
Some((path, method)) => (path, method),
None => {
shell.error("Could not find any NDK.")?;
Expand All @@ -52,6 +60,19 @@ pub fn run(args: Vec<String>) -> anyhow::Result<()> {
};

let ndk_version = derive_ndk_version(&ndk_home)?;
shell.verbose(|shell| {
shell.status_with_color(
"Detected",
format!(
"NDK v{} ({}) [{}]",
ndk_version,
ndk_home.display(),
ndk_detection_method
),
termcolor::Color::Cyan,
)
})?;

let clang_target = clang_target(args.target.triple(), args.platform);

// Try command line, then config. Config falls back to defaults in any case.
Expand Down
2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ fn init(args: Vec<String>) -> anyhow::Result<(Shell, Vec<String>)> {
std::process::exit(0);
}

let verbosity = if args.contains_str("-q") {
let verbosity = if args.contains_str("-q") || args.contains_str("--quiet") {
Verbosity::Quiet
} else if args.contains_str("-vv") {
Verbosity::VeryVerbose
Expand Down
Loading