Skip to content

Commit ef5bfbc

Browse files
authored
Merge branch 'main' into ci/riscv64-release
2 parents 77e9b57 + f822450 commit ef5bfbc

77 files changed

Lines changed: 197 additions & 318 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ eza’s options are almost, but not quite, entirely unlike `ls`’s. Quick overv
110110
- **--colo[u]r-scale=(field)**: highlight levels of `field` distinctly(all, age, size)
111111
- **--color-scale-mode=(mode)**: use gradient or fixed colors in --color-scale. valid options are `fixed` or `gradient`
112112
- **--icons=(when)**: when to display icons (always, auto, never)
113-
- **--hyperlink**: display entries as hyperlinks
113+
- **--hyperlink=(when)**: when to display entries as hyperlinks (always, auto, never)
114114
- **--absolute=(mode)**: display entries with their absolute path (on, follow, off)
115115
- **-w**, **--width=(columns)**: set screen width in columns
116116

completions/bash/eza

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ _eza() {
1818
return
1919
;;
2020

21+
--hyperlink)
22+
mapfile -t COMPREPLY < <(compgen -W 'always automatic auto never' -- "$cur")
23+
return
24+
;;
25+
2126
-L|--level)
2227
mapfile -t COMPREPLY < <(compgen -W '{0..9}' -- "$cur")
2328
return

completions/fish/eza.fish

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ complete -c eza -l icons -d "When to display icons" -x -a "
3737
never\t'Never display icons'
3838
"
3939
complete -c eza -l no-quotes -d "Don't quote file names with spaces"
40-
complete -c eza -l hyperlink -d "Display entries as hyperlinks"
40+
complete -c eza -l hyperlink -d "When to display entries as hyperlinks" -x -a "
41+
always\t'Always display entries as hyperlinks'
42+
auto\t'Display hyperlinks if standard output is a terminal'
43+
automatic\t'Display hyperlinks if standard output is a terminal'
44+
never\t'Never display entries as hyperlinks'
45+
"
4146
complete -c eza -l follow-symlinks -d "Drill down into symbolic links that point to directories"
4247
complete -c eza -l absolute -d "Display entries with their absolute path" -x -a "
4348
on\t'Show absolute path for listed entries'

completions/nush/eza.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export extern "eza" [
1717
--colour-scale-mode # Use gradient or fixed colors in --colour-scale
1818
--icons # When to display icons
1919
--no-quotes # Don't quote file names with spaces
20-
--hyperlink # Display entries as hyperlinks
20+
--hyperlink # When to display entries as hyperlinks
2121
--absolute # Display entries with their absolute path
2222
--follow-symlinks # Drill down into symbolic links that point to directories
2323
--group-directories-first # Sort directories before other files

completions/pwsh/_eza.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ Register-ArgumentCompleter -Native -CommandName 'eza' -ScriptBlock {
7777
ForEach-Object {[System.Management.Automation.CompletionResult]::new($_, $_, "ParameterValue", $_)}
7878
break
7979
}
80+
'*;--hyperlink' {
81+
$ArrayWhen |
82+
ForEach-Object {[System.Management.Automation.CompletionResult]::new($_, $_, "ParameterValue", $_)}
83+
break
84+
}
8085
'*;--all' {
8186
[CompletionResult]::new('--show-symlinks' ,'listfilessyl' , [CompletionResultType]::ParameterName, 'explicitly show symbolic links (for use with --only-dirs | --only-files)')
8287
[CompletionResult]::new('--no-symlinks' ,'listfilessyl' , [CompletionResultType]::ParameterName, 'do not show symbolic links')
@@ -158,7 +163,7 @@ Register-ArgumentCompleter -Native -CommandName 'eza' -ScriptBlock {
158163
# [CompletionResult]::new('--colour-scale-mode' ,'colorscalemode' , [CompletionResultType]::ParameterName, 'use gradient or fixed colors in --color-scale (fixed, gradient)')
159164
[CompletionResult]::new('--icons' ,'icons' , [CompletionResultType]::ParameterName, 'when to display icons (always, auto, never)')
160165
[CompletionResult]::new('--no-quotes' ,'noquotes' , [CompletionResultType]::ParameterName, 'don''t quote file names with spaces')
161-
[CompletionResult]::new('--hyperlink' ,'hyperlink' , [CompletionResultType]::ParameterName, 'display entries as hyperlinks')
166+
[CompletionResult]::new('--hyperlink' ,'hyperlink' , [CompletionResultType]::ParameterName, 'when to display entries as hyperlinks (always, auto, never)')
162167
[CompletionResult]::new('--absolute' ,'absolute' , [CompletionResultType]::ParameterName, 'display entries with their absolute path (on, follow, off)')
163168
[CompletionResult]::new('--follow-symlinks' ,'followsymlinks' , [CompletionResultType]::ParameterName, 'drill down into symbolic links that point to directories')
164169
# [CompletionResult]::new('-w' ,'widths' , [CompletionResultType]::ParameterName, 'set screen width in columns')

completions/zsh/_eza

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __eza() {
2525
--colo{,u}r-scale-mode"[Use gradient or fixed colors in --color-scale]:(mode):(fixed gradient)" \
2626
--icons="[When to display icons]:(when):(always auto automatic never)" \
2727
--no-quotes"[Don't quote filenames with spaces]" \
28-
--hyperlink"[Display entries as hyperlinks]" \
28+
--hyperlink="[When to display entries as hyperlinks]:(when):(always auto automatic never)" \
2929
--absolute"[Display entries with their absolute path]:(mode):(on follow off)" \
3030
--follow-symlinks"[Drill down into symbolic links that point to directories]" \
3131
--group-directories-first"[Sort directories before other files]" \

man/eza.1.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,14 @@ When used without a value, defaults to ‘`automatic`’.
123123
`--no-quotes`
124124
: Don't quote file names with spaces.
125125

126-
`--hyperlink`
126+
`--hyperlink=WHEN`
127127
: Display entries as hyperlinks
128128

129+
Valid settings are ‘`always`’, ‘`automatic`’ (‘`auto`’ for short), and ‘`never`’.
130+
When used without a value, defaults to ‘`automatic`’.
131+
132+
`automatic` or `auto` will display hyperlinks only when the standard output is connected to a real terminal. If `eza` is ran while in a `tty`, or the output of `eza` is either redirected to a file or piped into another program, hyperlinks will not be used. Setting this option to ‘`always`’ causes `eza` to always display hyperlinks, while ‘`never`’ disables the use of hyperlinks.
133+
129134
`-w`, `--width=COLS`
130135
: Set screen width in columns.
131136

nix/trycmd.nix

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
bash devtools/dir-generator.sh tests/test_dir && echo "Dir generated"
2222
bash devtools/generate-timestamp-test-dir.sh tests/timestamp_test_dir
2323
'';
24-
cargoTestOptions = opts: opts ++ [ "--features nix" ];
24+
cargoTestOptions =
25+
opts:
26+
opts
27+
++ [
28+
"--features nix"
29+
"--features nix-local"
30+
"--features powertest"
31+
];
2532
inherit buildInputs;
2633
nativeBuildInputs = with pkgs; [ git ];
2734
};

powertest.yaml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ commands:
6969
? - null
7070
- --hyperlink
7171
:
72+
? - null
73+
- --hyperlink
74+
: values:
75+
- auto
76+
- always
77+
- never
7278
? - null
7379
- --absolute
7480
: values:
@@ -114,27 +120,27 @@ commands:
114120
: short: -s
115121
long: time-style
116122
prefix: -l
117-
values:
118-
#- accessed
119-
- age
120-
#- changed
121-
#- created
122-
- date
123+
values: # non-deterministic results with our setup (tests/test_dir) are commented out
124+
# - accessed
125+
# - age
126+
# - changed
127+
# - created
128+
# - date
123129
- Ext
124130
- ext
125131
- Extension
126132
- extension
127133
- Filename
128134
- filename
129-
- inode
130-
- modified
135+
# - inode
136+
# - modified
131137
- Name
132138
- name
133-
- newest
134-
#- none seems non-deterministic
135-
- oldest
136-
- size
137-
- time
139+
# - newest
140+
# - none
141+
# - oldest
142+
# - size
143+
# - time
138144
- type
139145
? - null
140146
- --group-directories-first

src/options/file_name.rs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ impl QuoteStyle {
9595

9696
impl EmbedHyperlinks {
9797
fn deduce(matches: &ArgMatches) -> Self {
98-
if matches.get_flag("hyperlink") {
99-
Self::On
100-
} else {
101-
Self::Off
98+
match matches.get_one("hyperlink") {
99+
Some(ShowWhen::Never) | None => Self::Never,
100+
Some(ShowWhen::Always) => Self::Always,
101+
Some(ShowWhen::Auto) => Self::Automatic,
102102
}
103103
}
104104
}
@@ -149,18 +149,34 @@ mod tests {
149149
}
150150

151151
#[test]
152-
fn deduce_embed_hyperlinks_on() {
152+
fn deduce_embed_hyperlinks_auto() {
153153
assert_eq!(
154154
EmbedHyperlinks::deduce(&mock_cli(vec!["--hyperlink"])),
155-
EmbedHyperlinks::On
155+
EmbedHyperlinks::Automatic
156+
);
157+
assert_eq!(
158+
EmbedHyperlinks::deduce(&mock_cli(vec!["--hyperlink", "auto"])),
159+
EmbedHyperlinks::Automatic
160+
);
161+
}
162+
163+
#[test]
164+
fn deduce_embed_hyperlinks_always() {
165+
assert_eq!(
166+
EmbedHyperlinks::deduce(&mock_cli(vec!["--hyperlink", "always"])),
167+
EmbedHyperlinks::Always
156168
);
157169
}
158170

159171
#[test]
160-
fn deduce_embed_hyperlinks_off() {
172+
fn deduce_embed_hyperlinks_never() {
173+
assert_eq!(
174+
EmbedHyperlinks::deduce(&mock_cli(vec!["--hyperlink", "never"])),
175+
EmbedHyperlinks::Never
176+
);
161177
assert_eq!(
162178
EmbedHyperlinks::deduce(&mock_cli(vec![""])),
163-
EmbedHyperlinks::Off
179+
EmbedHyperlinks::Never
164180
);
165181
}
166182

@@ -254,7 +270,7 @@ mod tests {
254270
classify: Classify::JustFilenames,
255271
show_icons: ShowIcons::Never,
256272
quote_style: QuoteStyle::QuoteSpaces,
257-
embed_hyperlinks: EmbedHyperlinks::Off,
273+
embed_hyperlinks: EmbedHyperlinks::Never,
258274
absolute: Absolute::Off,
259275
is_a_tty: true,
260276
})

0 commit comments

Comments
 (0)