Jelajahi Sumber

fix: lifetime annotations and manpage/shell completion nits

PThorpe92 2 tahun lalu
induk
melakukan
c6eab635b9
6 mengubah file dengan 9 tambahan dan 8 penghapusan
  1. 1 1
      completions/fish/eza.fish
  2. 1 1
      completions/nush/eza.nu
  3. 1 1
      completions/zsh/_eza
  4. 2 2
      man/eza.1.md
  5. 2 1
      src/main.rs
  6. 2 2
      src/options/mod.rs

+ 1 - 1
completions/fish/eza.fish

@@ -110,7 +110,7 @@ complete -c eza -l no-filesize -d "Suppress the filesize field"
 complete -c eza -l no-user -d "Suppress the user field"
 complete -c eza -l no-time -d "Suppress the time field"
 complete -c eza -s M -l mounts -d "Show mount details"
-complete -c eza -l stdin -d "Read file names from standard input"
+complete -c eza -l stdin -d "When piping to eza. Read file names from stdin"
 
 # Optional extras
 complete -c eza -l git -d "List each file's Git status, if tracked"

+ 1 - 1
completions/nush/eza.nu

@@ -58,5 +58,5 @@ export extern "eza" [
     --extended(-@)             # List each file's extended attributes and sizes
     --context(-Z)              # List each file's security context
     --smart-group              # Only show group if it has a different name from owner
-    --stdin                    # Read file paths from stdin
+    --stdin                    # When piping to eza. Read file paths from stdin
 ]

+ 1 - 1
completions/zsh/_eza

@@ -68,7 +68,7 @@ __eza() {
         {-M,--mounts}"[Show mount details (long mode only)]" \
         '*:filename:_files' \
         --smart-group"[Only show group if it has a different name from owner]" \
-        --stdin"[Read file names from stdin]"
+        --stdin"[When piping to eza. Read file names from stdin]"
 }
 
 __eza

+ 2 - 2
man/eza.1.md

@@ -238,7 +238,7 @@ These options are available when running with `--long` (`-l`):
 : Suppress the time field.
 
 `--stdin`
-: read file names from stdin, one per line or other separator specified in environment
+: When you wish to pipe directories to eza/read from stdin. Separate one per line or define custom separation char in `EZA_STDIN_SEPARATOR` env variable.
 
 `-@`, `--extended`
 : List each file’s extended attributes and sizes.
@@ -328,7 +328,7 @@ Any explicit use of the `--icons=WHEN` flag overrides this behavior.
 
 ## `EZA_STDIN_SEPARATOR`
 
-Specifies the separator to use when reading file names from stdin. Defaults to newline.
+Specifies the separator to use when file names are piped from stdin. Defaults to newline.
 
 EXIT STATUSES
 =============

+ 2 - 1
src/main.rs

@@ -78,7 +78,8 @@ fn main() {
                         input_paths.extend(
                             input
                                 .split(&separator.clone().into_string().unwrap_or("\n".to_string()))
-                                .map(std::ffi::OsStr::new).filter(|s| !s.is_empty())
+                                .map(std::ffi::OsStr::new)
+                                .filter(|s| !s.is_empty())
                                 .collect::<Vec<_>>(),
                         );
                     }

+ 2 - 2
src/options/mod.rs

@@ -125,12 +125,12 @@ pub struct Options {
     pub stdin: FilesInput,
 }
 
-impl<'args> Options {
+impl Options {
     /// Parse the given iterator of command-line strings into an Options
     /// struct and a list of free filenames, using the environment variables
     /// for extra options.
     #[allow(unused_results)]
-    pub fn parse<I, V>(args: I, vars: &V) -> OptionsResult<'args>
+    pub fn parse<'args, I, V>(args: I, vars: &V) -> OptionsResult<'args>
     where
         I: IntoIterator<Item = &'args OsStr>,
         V: Vars,