diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 19:39:04 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 19:39:04 +0900 |
| commit | 3813267fed5fcc7e9b7f867a9c17c98faf545020 (patch) | |
| tree | 8d3301f5e6f9067bf87fa8218260750ffc51bd85 /crates | |
| parent | 2a2e800100cdaf3fc5f74c3a00ecb73e9cac07f3 (diff) | |
| download | php-mozart-3813267fed5fcc7e9b7f867a9c17c98faf545020.tar.gz php-mozart-3813267fed5fcc7e9b7f867a9c17c98faf545020.tar.zst php-mozart-3813267fed5fcc7e9b7f867a9c17c98faf545020.zip | |
fix(licenses): match Composer text output format
Add "Dependencies:" label and remove column headers/separator from
text output to align with Composer's licenses command behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/mozart/src/commands/licenses.rs | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs index c7e79ae..e68c469 100644 --- a/crates/mozart/src/commands/licenses.rs +++ b/crates/mozart/src/commands/licenses.rs @@ -179,6 +179,7 @@ fn render_text(root_name: &str, root_version: &str, root_license: &str, entries: println!("Name: {}", root_name); println!("Version: {}", root_version); println!("Licenses: {}", root_license); + println!("Dependencies:"); println!(); if entries.is_empty() { @@ -186,34 +187,8 @@ fn render_text(root_name: &str, root_version: &str, root_license: &str, entries: } // Compute column widths - let name_width = entries - .iter() - .map(|e| e.name.len()) - .max() - .unwrap_or(0) - .max("Name".len()); - let version_width = entries - .iter() - .map(|e| e.version.len()) - .max() - .unwrap_or(0) - .max("Version".len()); - - // Print header - println!( - "{:<nw$} {:<vw$} License", - "Name", - "Version", - nw = name_width, - vw = version_width - ); - println!( - "{:-<nw$} {:-<vw$} -------", - "", - "", - nw = name_width, - vw = version_width - ); + let name_width = entries.iter().map(|e| e.name.len()).max().unwrap_or(0); + let version_width = entries.iter().map(|e| e.version.len()).max().unwrap_or(0); for entry in entries { let license_str = if entry.licenses.is_empty() { |
