Skip to content

Commit

Permalink
Include the license text when running in verbose mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnando committed Jan 16, 2025
1 parent d00b26f commit f80152a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,11 @@ Print version information

Show dependency licenses

**Usage:** `stellar licenses`
**Usage:** `stellar licenses [OPTIONS]`

###### **Options:**

* `-v`, `--verbose` — Display the license text



13 changes: 12 additions & 1 deletion cmd/soroban-cli/src/commands/licenses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use license_fetcher::get_package_list_macro;

#[derive(Parser, Debug, Clone)]
#[group(skip)]
pub struct Cmd;
pub struct Cmd {
/// Display the license text.
#[arg(long, short)]
pub verbose: bool,
}

impl Cmd {
#[allow(clippy::unused_self)]
Expand All @@ -31,6 +35,13 @@ impl Cmd {
println!("URL: {url}");
}

if self.verbose {
if let Some(text) = pkg.license_text.clone() {
println!("{text}");
println!("———");
}
}

println!();
});
}
Expand Down

0 comments on commit f80152a

Please sign in to comment.