diff --git a/dev/settings.html b/dev/settings.html index 6c6201def..7d1942d25 100644 --- a/dev/settings.html +++ b/dev/settings.html @@ -1,9 +1,9 @@
// This file is part of the uutils coreutils package. // // (c) Fangxu Hu <framlog@gmail.com> @@ -1067,6 +1068,7 @@ mounts .into_iter() .filter_map(|m| Filesystem::new(m, None)) + .filter(|fs| opt.show_all_fs || fs.usage.blocks > 0) .collect() } @@ -1142,7 +1144,7 @@ let filesystems = get_all_filesystems(&opt); if filesystems.is_empty() { - return Err(USimpleError::new(1, "No file systems processed")); + return Err(USimpleError::new(1, "no file systems processed")); } filesystems diff --git a/dev/src/uu_df/table.rs.html b/dev/src/uu_df/table.rs.html index 696ef9c4a..ed65930a0 100644 --- a/dev/src/uu_df/table.rs.html +++ b/dev/src/uu_df/table.rs.html @@ -804,6 +804,16 @@ 799 800 801 +802 +803 +804 +805 +806 +807 +808 +809 +810 +811
// * This file is part of the uutils coreutils package. // * // * For the full copyright and license information, please view the LICENSE @@ -814,6 +824,7 @@ //! A table ([`Table`]) comprises a header row ([`Header`]) and a //! collection of data rows ([`Row`]), one per filesystem. use number_prefix::NumberPrefix; +use unicode_width::UnicodeWidthStr; use crate::columns::{Alignment, Column}; use crate::filesystem::Filesystem; @@ -1168,8 +1179,8 @@ total += row; for (i, value) in values.iter().enumerate() { - if value.len() > widths[i] { - widths[i] = value.len(); + if UnicodeWidthStr::width(value.as_str()) > widths[i] { + widths[i] = UnicodeWidthStr::width(value.as_str()); } } @@ -1206,12 +1217,21 @@ while let Some(row) = row_iter.next() { let mut col_iter = row.iter().enumerate().peekable(); while let Some((i, elem)) = col_iter.next() { + let is_last_col = col_iter.peek().is_none(); + match self.alignments[i] { - Alignment::Left => write!(f, "{:<width$}", elem, width = self.widths[i])?, + Alignment::Left => { + if is_last_col { + // no trailing spaces in last column + write!(f, "{}", elem)?; + } else { + write!(f, "{:<width$}", elem, width = self.widths[i])?; + } + } Alignment::Right => write!(f, "{:>width$}", elem, width = self.widths[i])?, } - if col_iter.peek().is_some() { + if !is_last_col { // column separator write!(f, " ")?; } diff --git a/dev/uu_df/fn.uu_app.html b/dev/uu_df/fn.uu_app.html index 29d2b8ac1..35cff6d50 100644 --- a/dev/uu_df/fn.uu_app.html +++ b/dev/uu_df/fn.uu_app.html @@ -4,5 +4,5 @@
pub fn uu_app<'a>() -> Command<'a>