Skip to content

Commit 15768f6

Browse files
committed
refactor(args): move one_file_system between deduplicate_hardlinks and top_down
https://claude.ai/code/session_01LfpnUZrgq93MVZgA3KVqE6
1 parent b48921b commit 15768f6

10 files changed

Lines changed: 26 additions & 26 deletions

File tree

USAGE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ How to display the numbers of bytes.
3939

4040
Detect and subtract the sizes of hardlinks from their parent directory totals.
4141

42+
<a id="option-x" name="option-x"></a><a id="one-file-system" name="one-file-system"></a>
43+
### `--one-file-system`
44+
45+
* _Aliases:_ `-x`.
46+
47+
Skip directories on different filesystems.
48+
4249
<a id="top-down" name="top-down"></a>
4350
### `--top-down`
4451

@@ -101,13 +108,6 @@ Do not sort the branches in the tree.
101108

102109
Prevent filesystem error messages from appearing in stderr.
103110

104-
<a id="option-x" name="option-x"></a><a id="one-file-system" name="one-file-system"></a>
105-
### `--one-file-system`
106-
107-
* _Aliases:_ `-x`.
108-
109-
Skip directories on different filesystems.
110-
111111
<a id="option-p" name="option-p"></a><a id="progress" name="progress"></a>
112112
### `--progress`
113113

exports/completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _pdu() {
2323

2424
case "${cmd}" in
2525
pdu)
26-
opts="-b -H -q -d -w -m -s -x -p -h -V --json-input --json-output --bytes-format --detect-links --dedupe-links --deduplicate-hardlinks --top-down --align-right --quantity --depth --max-depth --width --total-width --column-width --min-ratio --no-sort --no-errors --silent-errors --one-file-system --progress --threads --omit-json-shared-details --omit-json-shared-summary --help --version [FILES]..."
26+
opts="-b -H -x -q -d -w -m -s -p -h -V --json-input --json-output --bytes-format --detect-links --dedupe-links --deduplicate-hardlinks --one-file-system --top-down --align-right --quantity --depth --max-depth --width --total-width --column-width --min-ratio --no-sort --no-errors --silent-errors --progress --threads --omit-json-shared-details --omit-json-shared-summary --help --version [FILES]..."
2727
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
2828
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
2929
return 0

exports/completion.elv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ set edit:completion:arg-completer[pdu] = {|@words|
3838
cand --deduplicate-hardlinks 'Detect and subtract the sizes of hardlinks from their parent directory totals'
3939
cand --detect-links 'Detect and subtract the sizes of hardlinks from their parent directory totals'
4040
cand --dedupe-links 'Detect and subtract the sizes of hardlinks from their parent directory totals'
41+
cand -x 'Skip directories on different filesystems'
42+
cand --one-file-system 'Skip directories on different filesystems'
4143
cand --top-down 'Print the tree top-down instead of bottom-up'
4244
cand --align-right 'Set the root of the bars to the right'
4345
cand --no-sort 'Do not sort the branches in the tree'
4446
cand -s 'Prevent filesystem error messages from appearing in stderr'
4547
cand --silent-errors 'Prevent filesystem error messages from appearing in stderr'
4648
cand --no-errors 'Prevent filesystem error messages from appearing in stderr'
47-
cand -x 'Skip directories on different filesystems'
48-
cand --one-file-system 'Skip directories on different filesystems'
4949
cand -p 'Report progress being made at the expense of performance'
5050
cand --progress 'Report progress being made at the expense of performance'
5151
cand --omit-json-shared-details 'Do not output `.shared.details` in the JSON output'

exports/completion.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ complete -c pdu -l threads -d 'Set the maximum number of threads to spawn. Could
1212
complete -c pdu -l json-input -d 'Read JSON data from stdin'
1313
complete -c pdu -l json-output -d 'Print JSON data instead of an ASCII chart'
1414
complete -c pdu -s H -l deduplicate-hardlinks -l detect-links -l dedupe-links -d 'Detect and subtract the sizes of hardlinks from their parent directory totals'
15+
complete -c pdu -s x -l one-file-system -d 'Skip directories on different filesystems'
1516
complete -c pdu -l top-down -d 'Print the tree top-down instead of bottom-up'
1617
complete -c pdu -l align-right -d 'Set the root of the bars to the right'
1718
complete -c pdu -l no-sort -d 'Do not sort the branches in the tree'
1819
complete -c pdu -s s -l silent-errors -l no-errors -d 'Prevent filesystem error messages from appearing in stderr'
19-
complete -c pdu -s x -l one-file-system -d 'Skip directories on different filesystems'
2020
complete -c pdu -s p -l progress -d 'Report progress being made at the expense of performance'
2121
complete -c pdu -l omit-json-shared-details -d 'Do not output `.shared.details` in the JSON output'
2222
complete -c pdu -l omit-json-shared-summary -d 'Do not output `.shared.summary` in the JSON output'

exports/completion.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ Register-ArgumentCompleter -Native -CommandName 'pdu' -ScriptBlock {
4141
[CompletionResult]::new('--deduplicate-hardlinks', '--deduplicate-hardlinks', [CompletionResultType]::ParameterName, 'Detect and subtract the sizes of hardlinks from their parent directory totals')
4242
[CompletionResult]::new('--detect-links', '--detect-links', [CompletionResultType]::ParameterName, 'Detect and subtract the sizes of hardlinks from their parent directory totals')
4343
[CompletionResult]::new('--dedupe-links', '--dedupe-links', [CompletionResultType]::ParameterName, 'Detect and subtract the sizes of hardlinks from their parent directory totals')
44+
[CompletionResult]::new('-x', '-x', [CompletionResultType]::ParameterName, 'Skip directories on different filesystems')
45+
[CompletionResult]::new('--one-file-system', '--one-file-system', [CompletionResultType]::ParameterName, 'Skip directories on different filesystems')
4446
[CompletionResult]::new('--top-down', '--top-down', [CompletionResultType]::ParameterName, 'Print the tree top-down instead of bottom-up')
4547
[CompletionResult]::new('--align-right', '--align-right', [CompletionResultType]::ParameterName, 'Set the root of the bars to the right')
4648
[CompletionResult]::new('--no-sort', '--no-sort', [CompletionResultType]::ParameterName, 'Do not sort the branches in the tree')
4749
[CompletionResult]::new('-s', '-s', [CompletionResultType]::ParameterName, 'Prevent filesystem error messages from appearing in stderr')
4850
[CompletionResult]::new('--silent-errors', '--silent-errors', [CompletionResultType]::ParameterName, 'Prevent filesystem error messages from appearing in stderr')
4951
[CompletionResult]::new('--no-errors', '--no-errors', [CompletionResultType]::ParameterName, 'Prevent filesystem error messages from appearing in stderr')
50-
[CompletionResult]::new('-x', '-x', [CompletionResultType]::ParameterName, 'Skip directories on different filesystems')
51-
[CompletionResult]::new('--one-file-system', '--one-file-system', [CompletionResultType]::ParameterName, 'Skip directories on different filesystems')
5252
[CompletionResult]::new('-p', '-p', [CompletionResultType]::ParameterName, 'Report progress being made at the expense of performance')
5353
[CompletionResult]::new('--progress', '--progress', [CompletionResultType]::ParameterName, 'Report progress being made at the expense of performance')
5454
[CompletionResult]::new('--omit-json-shared-details', '--omit-json-shared-details', [CompletionResultType]::ParameterName, 'Do not output `.shared.details` in the JSON output')

exports/completion.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ block-count\:"Count numbers of blocks"))' \
4343
'--deduplicate-hardlinks[Detect and subtract the sizes of hardlinks from their parent directory totals]' \
4444
'--detect-links[Detect and subtract the sizes of hardlinks from their parent directory totals]' \
4545
'--dedupe-links[Detect and subtract the sizes of hardlinks from their parent directory totals]' \
46+
'-x[Skip directories on different filesystems]' \
47+
'--one-file-system[Skip directories on different filesystems]' \
4648
'--top-down[Print the tree top-down instead of bottom-up]' \
4749
'--align-right[Set the root of the bars to the right]' \
4850
'--no-sort[Do not sort the branches in the tree]' \
4951
'-s[Prevent filesystem error messages from appearing in stderr]' \
5052
'--silent-errors[Prevent filesystem error messages from appearing in stderr]' \
5153
'--no-errors[Prevent filesystem error messages from appearing in stderr]' \
52-
'-x[Skip directories on different filesystems]' \
53-
'--one-file-system[Skip directories on different filesystems]' \
5454
'-p[Report progress being made at the expense of performance]' \
5555
'--progress[Report progress being made at the expense of performance]' \
5656
'--omit-json-shared-details[Do not output \`.shared.details\` in the JSON output]' \

exports/long.help

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ Options:
3131

3232
[aliases: --detect-links, --dedupe-links]
3333

34+
-x, --one-file-system
35+
Skip directories on different filesystems
36+
3437
--top-down
3538
Print the tree top-down instead of bottom-up
3639

@@ -74,9 +77,6 @@ Options:
7477

7578
[aliases: --no-errors]
7679

77-
-x, --one-file-system
78-
Skip directories on different filesystems
79-
8080
-p, --progress
8181
Report progress being made at the expense of performance
8282

exports/short.help

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Options:
1414
How to display the numbers of bytes [default: metric] [possible values: plain, metric, binary]
1515
-H, --deduplicate-hardlinks
1616
Detect and subtract the sizes of hardlinks from their parent directory totals [aliases: --detect-links, --dedupe-links]
17+
-x, --one-file-system
18+
Skip directories on different filesystems
1719
--top-down
1820
Print the tree top-down instead of bottom-up
1921
--align-right
@@ -32,8 +34,6 @@ Options:
3234
Do not sort the branches in the tree
3335
-s, --silent-errors
3436
Prevent filesystem error messages from appearing in stderr [aliases: --no-errors]
35-
-x, --one-file-system
36-
Skip directories on different filesystems
3737
-p, --progress
3838
Report progress being made at the expense of performance
3939
--threads <THREADS>

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ impl App {
291291
progress: $progress,
292292
#[cfg(unix)] deduplicate_hardlinks: $hardlinks,
293293
#[cfg(not(unix))] deduplicate_hardlinks: _,
294+
one_file_system,
294295
files,
295296
json_output,
296297
bytes_format,
@@ -299,7 +300,6 @@ impl App {
299300
max_depth,
300301
min_ratio,
301302
no_sort,
302-
one_file_system,
303303
omit_json_shared_details,
304304
omit_json_shared_summary,
305305
..

src/args.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ pub struct Args {
112112
#[cfg_attr(not(unix), clap(hide = true))]
113113
pub deduplicate_hardlinks: bool,
114114

115+
/// Skip directories on different filesystems.
116+
#[clap(long, short = 'x')]
117+
#[cfg_attr(not(unix), clap(hide = true))]
118+
pub one_file_system: bool,
119+
115120
/// Print the tree top-down instead of bottom-up.
116121
#[clap(long)]
117122
pub top_down: bool,
@@ -155,11 +160,6 @@ pub struct Args {
155160
#[clap(long, short, visible_alias = "no-errors")]
156161
pub silent_errors: bool,
157162

158-
/// Skip directories on different filesystems.
159-
#[clap(long, short = 'x')]
160-
#[cfg_attr(not(unix), clap(hide = true))]
161-
pub one_file_system: bool,
162-
163163
/// Report progress being made at the expense of performance.
164164
#[clap(long, short)]
165165
pub progress: bool,

0 commit comments

Comments
 (0)