bashkit 0.8.0

Awesomely fast virtual sandbox with bash and file system
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
// GENERATED by bashkit-coreutils-port. DO NOT EDIT.
//
// Source: uutils/coreutils@39364b6 src/uu/ls/
// Regenerate: cargo run -p bashkit-coreutils-port -- <UUTILS_DIR> ls <REV>
//
// Original uutils licensed MIT; see THIRD_PARTY_LICENSES.

#![allow(unused_imports, dead_code)]
use clap::builder::{
    NonEmptyStringValueParser, PossibleValue, PossibleValuesParser, TypedValueParser, ValueParser,
    ValueParserFactory,
};
use clap::{Arg, ArgAction, Command};
use std::ffi::{OsStr, OsString};
use std::ops::RangeInclusive;
use std::path::PathBuf;
use std::str::FromStr;
pub mod options {
    pub mod format {
        pub static ONE_LINE: &str = "1";
        pub static LONG: &str = "long";
        pub static COLUMNS: &str = "C";
        pub static ACROSS: &str = "x";
        pub static TAB_SIZE: &str = "tabsize";
        pub static COMMAS: &str = "m";
        pub static LONG_NO_OWNER: &str = "g";
        pub static LONG_NO_GROUP: &str = "o";
        pub static LONG_NUMERIC_UID_GID: &str = "numeric-uid-gid";
    }
    pub mod files {
        pub static ALL: &str = "all";
        pub static ALMOST_ALL: &str = "almost-all";
        pub static UNSORTED_ALL: &str = "f";
    }
    pub mod sort {
        pub static SIZE: &str = "S";
        pub static TIME: &str = "t";
        pub static NONE: &str = "U";
        pub static VERSION: &str = "v";
        pub static EXTENSION: &str = "X";
    }
    pub mod time {
        pub static ACCESS: &str = "u";
        pub static CHANGE: &str = "c";
    }
    pub mod size {
        pub static ALLOCATION_SIZE: &str = "size";
        pub static BLOCK_SIZE: &str = "block-size";
        pub static HUMAN_READABLE: &str = "human-readable";
        pub static SI: &str = "si";
        pub static KIBIBYTES: &str = "kibibytes";
    }
    pub mod quoting {
        pub static ESCAPE: &str = "escape";
        pub static LITERAL: &str = "literal";
        pub static C: &str = "quote-name";
    }
    pub mod indicator_style {
        pub static SLASH: &str = "p";
        pub static FILE_TYPE: &str = "file-type";
        pub static CLASSIFY: &str = "classify";
    }
    pub mod dereference {
        pub static ALL: &str = "dereference";
        pub static ARGS: &str = "dereference-command-line";
        pub static DIR_ARGS: &str = "dereference-command-line-symlink-to-dir";
    }
    pub static HELP: &str = "help";
    pub static QUOTING_STYLE: &str = "quoting-style";
    pub static HIDE_CONTROL_CHARS: &str = "hide-control-chars";
    pub static SHOW_CONTROL_CHARS: &str = "show-control-chars";
    pub static WIDTH: &str = "width";
    pub static AUTHOR: &str = "author";
    pub static NO_GROUP: &str = "no-group";
    pub static FORMAT: &str = "format";
    pub static SORT: &str = "sort";
    pub static TIME: &str = "time";
    pub static IGNORE_BACKUPS: &str = "ignore-backups";
    pub static DIRECTORY: &str = "directory";
    pub static INODE: &str = "inode";
    pub static REVERSE: &str = "reverse";
    pub static RECURSIVE: &str = "recursive";
    pub static COLOR: &str = "color";
    pub static PATHS: &str = "paths";
    pub static INDICATOR_STYLE: &str = "indicator-style";
    pub static TIME_STYLE: &str = "time-style";
    pub static FULL_TIME: &str = "full-time";
    pub static HIDE: &str = "hide";
    pub static IGNORE: &str = "ignore";
    pub static CONTEXT: &str = "context";
    pub static GROUP_DIRECTORIES_FIRST: &str = "group-directories-first";
    pub static ZERO: &str = "zero";
    pub static DIRED: &str = "dired";
    pub static HYPERLINK: &str = "hyperlink";
}
#[allow(unused_imports)]
use options::*;
/// Vendored stand-in for `uucore::format_usage`.
///
/// Upstream wraps the usage line with stylized "Usage:" prefix logic
/// driven by uucore's locale stack. For our purposes the raw string
/// is enough; clap's `override_usage` accepts the literal as-is.
fn format_usage(s: &str) -> String {
    s.to_string()
}
/// Sidecar harvest of every `Arg::env(...)` annotation the codegen
/// stripped from the runtime Arg chain (TM-INF-024). Consumed by
/// `crate::builtins::clap_env::apply_env_defaults` so bashkit's
/// virtual `ctx.env` — never `std::env` — drives clap's env-default
/// path. Order matches the chain order in the original `uu_app()`.
pub static LS_ENV_DEFAULTS: &[crate::builtins::clap_env::EnvDefault] = &[
    crate::builtins::clap_env::EnvDefault {
        arg_id: options::TIME_STYLE,
        long: options::TIME_STYLE,
        env_var: "TIME_STYLE",
        kind: crate::builtins::clap_env::EnvKind::Single,
    },
    crate::builtins::clap_env::EnvDefault {
        arg_id: options::format::TAB_SIZE,
        long: options::format::TAB_SIZE,
        env_var: "TABSIZE",
        kind: crate::builtins::clap_env::EnvKind::Single,
    },
];
pub fn ls_command() -> Command {
    Command::new("ls")
        .version(env!("CARGO_PKG_VERSION"))
        .override_usage(
            format_usage(&::std::string::String::from("ls [OPTION]... [FILE]...")),
        )
        .about(
            ::std::string::String::from(
                "List directory contents.\nIgnore files and directories starting with a '.' by default",
            ),
        )
        .infer_long_args(true)
        .disable_help_flag(true)
        .args_override_self(true)
        .arg(
            Arg::new(options::HELP)
                .long(options::HELP)
                .help(::std::string::String::from("Print help information."))
                .action(ArgAction::Help),
        )
        .arg(
            Arg::new(options::FORMAT)
                .long(options::FORMAT)
                .help(::std::string::String::from("Set the display format."))
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        "long",
                        "verbose",
                        "single-column",
                        "columns",
                        "vertical",
                        "across",
                        "horizontal",
                        "commas",
                    ]),
                )
                .hide_possible_values(true)
                .require_equals(true)
                .overrides_with_all([
                    options::FORMAT,
                    options::format::COLUMNS,
                    options::format::LONG,
                    options::format::ACROSS,
                    options::format::COLUMNS,
                    options::DIRED,
                ]),
        )
        .arg(
            Arg::new(options::format::COLUMNS)
                .short('C')
                .help(::std::string::String::from("Display the files in columns."))
                .overrides_with_all([
                    options::FORMAT,
                    options::format::COLUMNS,
                    options::format::LONG,
                    options::format::ACROSS,
                    options::format::COLUMNS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::format::LONG)
                .short('l')
                .long(options::format::LONG)
                .help(::std::string::String::from("Display detailed information."))
                .overrides_with_all([
                    options::FORMAT,
                    options::format::COLUMNS,
                    options::format::LONG,
                    options::format::ACROSS,
                    options::format::COLUMNS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::format::ACROSS)
                .short('x')
                .help(
                    ::std::string::String::from(
                        "List entries in rows instead of in columns.",
                    ),
                )
                .overrides_with_all([
                    options::FORMAT,
                    options::format::COLUMNS,
                    options::format::LONG,
                    options::format::ACROSS,
                    options::format::COLUMNS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::format::TAB_SIZE)
                .short('T')
                .long(options::format::TAB_SIZE)
                .value_name("COLS")
                .help(
                    ::std::string::String::from(
                        "Assume tab stops at each COLS instead of 8",
                    ),
                ),
        )
        .arg(
            Arg::new(options::format::COMMAS)
                .short('m')
                .help(::std::string::String::from("List entries separated by commas."))
                .overrides_with_all([
                    options::FORMAT,
                    options::format::COLUMNS,
                    options::format::LONG,
                    options::format::ACROSS,
                    options::format::COLUMNS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::ZERO)
                .long(options::ZERO)
                .overrides_with(options::ZERO)
                .help(
                    ::std::string::String::from(
                        "List entries separated by ASCII NUL characters.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::DIRED)
                .long(options::DIRED)
                .short('D')
                .help(
                    ::std::string::String::from(
                        "generate output designed for Emacs' dired (Directory Editor) mode",
                    ),
                )
                .action(ArgAction::SetTrue)
                .overrides_with(options::HYPERLINK),
        )
        .arg(
            Arg::new(options::HYPERLINK)
                .long(options::HYPERLINK)
                .help(::std::string::String::from("hyperlink file names WHEN"))
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        PossibleValue::new("always").alias("yes").alias("force"),
                        PossibleValue::new("auto").alias("tty").alias("if-tty"),
                        PossibleValue::new("never").alias("no").alias("none"),
                    ]),
                )
                .require_equals(true)
                .num_args(0..=1)
                .default_missing_value("always")
                .default_value("never")
                .value_name("WHEN")
                .overrides_with(options::DIRED),
        )
        .arg(
            Arg::new(options::format::ONE_LINE)
                .short('1')
                .help(::std::string::String::from("List one file per line."))
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::format::LONG_NO_GROUP)
                .short('o')
                .help(
                    ::std::string::String::from(
                        "Long format without group information.\nIdentical to --format=long with --no-group.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::format::LONG_NO_OWNER)
                .short('g')
                .help(
                    ::std::string::String::from("Long format without owner information."),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::format::LONG_NUMERIC_UID_GID)
                .short('n')
                .long(options::format::LONG_NUMERIC_UID_GID)
                .help(::std::string::String::from("-l with numeric UIDs and GIDs."))
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(QUOTING_STYLE)
                .long(QUOTING_STYLE)
                .help(::std::string::String::from("Set quoting style."))
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        PossibleValue::new("literal"),
                        PossibleValue::new("locale"),
                        PossibleValue::new("shell"),
                        PossibleValue::new("shell-escape"),
                        PossibleValue::new("shell-always"),
                        PossibleValue::new("shell-escape-always"),
                        PossibleValue::new("clocale"),
                        PossibleValue::new("c").alias("c-maybe"),
                        PossibleValue::new("escape"),
                    ]),
                )
                .overrides_with_all([
                    QUOTING_STYLE,
                    options::quoting::LITERAL,
                    options::quoting::ESCAPE,
                    options::quoting::C,
                ]),
        )
        .arg(
            Arg::new(options::quoting::LITERAL)
                .short('N')
                .long(options::quoting::LITERAL)
                .alias("l")
                .help(
                    ::std::string::String::from(
                        "Use literal quoting style. Equivalent to `--quoting-style=literal`",
                    ),
                )
                .overrides_with_all([
                    QUOTING_STYLE,
                    options::quoting::LITERAL,
                    options::quoting::ESCAPE,
                    options::quoting::C,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::quoting::ESCAPE)
                .short('b')
                .long(options::quoting::ESCAPE)
                .help(
                    ::std::string::String::from(
                        "Use escape quoting style. Equivalent to `--quoting-style=escape`",
                    ),
                )
                .overrides_with_all([
                    QUOTING_STYLE,
                    options::quoting::LITERAL,
                    options::quoting::ESCAPE,
                    options::quoting::C,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::quoting::C)
                .short('Q')
                .long(options::quoting::C)
                .help(
                    ::std::string::String::from(
                        "Use C quoting style. Equivalent to `--quoting-style=c`",
                    ),
                )
                .overrides_with_all([
                    QUOTING_STYLE,
                    options::quoting::LITERAL,
                    options::quoting::ESCAPE,
                    options::quoting::C,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::HIDE_CONTROL_CHARS)
                .short('q')
                .long(options::HIDE_CONTROL_CHARS)
                .help(
                    ::std::string::String::from(
                        "Replace control characters with '?' if they are not escaped.",
                    ),
                )
                .overrides_with_all([
                    options::HIDE_CONTROL_CHARS,
                    options::SHOW_CONTROL_CHARS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::SHOW_CONTROL_CHARS)
                .long(options::SHOW_CONTROL_CHARS)
                .help(
                    ::std::string::String::from(
                        "Show control characters 'as is' if they are not escaped.",
                    ),
                )
                .overrides_with_all([
                    options::HIDE_CONTROL_CHARS,
                    options::SHOW_CONTROL_CHARS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::TIME)
                .long(options::TIME)
                .help(
                    ::std::string::String::from(
                        "Show time in `<field>`:\naccess time (-u): atime, access, use;\nchange time (-t): ctime, status.\nmodification time: mtime, modification.\nbirth time: birth, creation;",
                    ),
                )
                .value_name("field")
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        PossibleValue::new("atime").alias("access").alias("use"),
                        PossibleValue::new("ctime").alias("status"),
                        PossibleValue::new("mtime").alias("modification"),
                        PossibleValue::new("birth").alias("creation"),
                    ]),
                )
                .hide_possible_values(true)
                .require_equals(true)
                .overrides_with_all([
                    options::TIME,
                    options::time::ACCESS,
                    options::time::CHANGE,
                ]),
        )
        .arg(
            Arg::new(options::time::CHANGE)
                .short('c')
                .help(
                    ::std::string::String::from(
                        "If the long listing format (e.g., -l, -o) is being used, print the\nstatus change time (the 'ctime' in the inode) instead of the modification\ntime. When explicitly sorting by time (--sort=time or -t) or when not\nusing a long listing format, sort according to the status change time.",
                    ),
                )
                .overrides_with_all([
                    options::TIME,
                    options::time::ACCESS,
                    options::time::CHANGE,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::time::ACCESS)
                .short('u')
                .help(
                    ::std::string::String::from(
                        "If the long listing format (e.g., -l, -o) is being used, print the\nstatus access time instead of the modification time. When explicitly\nsorting by time (--sort=time or -t) or when not using a long listing\nformat, sort according to the access time.",
                    ),
                )
                .overrides_with_all([
                    options::TIME,
                    options::time::ACCESS,
                    options::time::CHANGE,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::HIDE)
                .long(options::HIDE)
                .action(ArgAction::Append)
                .value_name("PATTERN")
                .help(
                    ::std::string::String::from(
                        "do not list implied entries matching shell PATTERN (overridden by -a or -A)",
                    ),
                ),
        )
        .arg(
            Arg::new(options::IGNORE)
                .short('I')
                .long(options::IGNORE)
                .action(ArgAction::Append)
                .value_name("PATTERN")
                .help(
                    ::std::string::String::from(
                        "do not list implied entries matching shell PATTERN",
                    ),
                ),
        )
        .arg(
            Arg::new(options::IGNORE_BACKUPS)
                .short('B')
                .long(options::IGNORE_BACKUPS)
                .help(::std::string::String::from("Ignore entries which end with ~."))
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::SORT)
                .long(options::SORT)
                .help(
                    ::std::string::String::from(
                        "Sort by `<field>`: name, none (-U), time (-t), size (-S), extension (-X) or width",
                    ),
                )
                .value_name("field")
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        "name",
                        "none",
                        "time",
                        "size",
                        "version",
                        "extension",
                        "width",
                    ]),
                )
                .require_equals(true)
                .overrides_with_all([
                    options::SORT,
                    options::sort::SIZE,
                    options::sort::TIME,
                    options::sort::NONE,
                    options::sort::VERSION,
                    options::sort::EXTENSION,
                ]),
        )
        .arg(
            Arg::new(options::sort::SIZE)
                .short('S')
                .help(::std::string::String::from("Sort by file size, largest first."))
                .overrides_with_all([
                    options::SORT,
                    options::sort::SIZE,
                    options::sort::TIME,
                    options::sort::NONE,
                    options::sort::VERSION,
                    options::sort::EXTENSION,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::sort::TIME)
                .short('t')
                .help(
                    ::std::string::String::from(
                        "Sort by modification time (the 'mtime' in the inode), newest first.",
                    ),
                )
                .overrides_with_all([
                    options::SORT,
                    options::sort::SIZE,
                    options::sort::TIME,
                    options::sort::NONE,
                    options::sort::VERSION,
                    options::sort::EXTENSION,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::sort::VERSION)
                .short('v')
                .help(
                    ::std::string::String::from(
                        "Natural sort of (version) numbers in the filenames.",
                    ),
                )
                .overrides_with_all([
                    options::SORT,
                    options::sort::SIZE,
                    options::sort::TIME,
                    options::sort::NONE,
                    options::sort::VERSION,
                    options::sort::EXTENSION,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::sort::EXTENSION)
                .short('X')
                .help(
                    ::std::string::String::from(
                        "Sort alphabetically by entry extension.",
                    ),
                )
                .overrides_with_all([
                    options::SORT,
                    options::sort::SIZE,
                    options::sort::TIME,
                    options::sort::NONE,
                    options::sort::VERSION,
                    options::sort::EXTENSION,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::sort::NONE)
                .short('U')
                .help(
                    ::std::string::String::from(
                        "Do not sort; list the files in whatever order they are stored in the\ndirectory.  This is especially useful when listing very large directories,\nsince not doing any sorting can be noticeably faster.",
                    ),
                )
                .overrides_with_all([
                    options::SORT,
                    options::sort::SIZE,
                    options::sort::TIME,
                    options::sort::NONE,
                    options::sort::VERSION,
                    options::sort::EXTENSION,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::dereference::ALL)
                .short('L')
                .long(options::dereference::ALL)
                .help(
                    ::std::string::String::from(
                        "When showing file information for a symbolic link, show information for the\nfile the link references rather than the link itself.",
                    ),
                )
                .overrides_with_all([
                    options::dereference::ALL,
                    options::dereference::DIR_ARGS,
                    options::dereference::ARGS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::dereference::DIR_ARGS)
                .long(options::dereference::DIR_ARGS)
                .help(
                    ::std::string::String::from(
                        "Do not follow symlinks except when they link to directories and are\ngiven as command line arguments.",
                    ),
                )
                .overrides_with_all([
                    options::dereference::ALL,
                    options::dereference::DIR_ARGS,
                    options::dereference::ARGS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::dereference::ARGS)
                .short('H')
                .long(options::dereference::ARGS)
                .help(
                    ::std::string::String::from(
                        "Do not follow symlinks except when given as command line arguments.",
                    ),
                )
                .overrides_with_all([
                    options::dereference::ALL,
                    options::dereference::DIR_ARGS,
                    options::dereference::ARGS,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::NO_GROUP)
                .long(options::NO_GROUP)
                .short('G')
                .help(::std::string::String::from("Do not show group in long format."))
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::AUTHOR)
                .long(options::AUTHOR)
                .help(
                    ::std::string::String::from(
                        "Show author in long format. On the supported platforms,\nthe author always matches the file owner.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::files::ALL)
                .short('a')
                .long(options::files::ALL)
                .overrides_with_all([options::files::ALL, options::files::ALMOST_ALL])
                .help(
                    ::std::string::String::from(
                        "Do not ignore hidden files (files with names that start with '.').",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::files::ALMOST_ALL)
                .short('A')
                .long(options::files::ALMOST_ALL)
                .overrides_with_all([options::files::ALL, options::files::ALMOST_ALL])
                .help(
                    ::std::string::String::from(
                        "In a directory, do not ignore all file names that start with '.',\nonly ignore '.' and '..'.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::files::UNSORTED_ALL)
                .short('f')
                .help(
                    ::std::string::String::from(
                        "List all files in directory order, unsorted. Equivalent to -aU. Disables --color unless explicitly specified.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::DIRECTORY)
                .short('d')
                .long(options::DIRECTORY)
                .help(
                    ::std::string::String::from(
                        "Only list the names of directories, rather than listing directory contents.\nThis will not follow symbolic links unless one of `--dereference-command-line\n(-H)`, `--dereference (-L)`, or `--dereference-command-line-symlink-to-dir` is\nspecified.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::size::HUMAN_READABLE)
                .short('h')
                .long(options::size::HUMAN_READABLE)
                .help(
                    ::std::string::String::from(
                        "Print human readable file sizes (e.g. 1K 234M 56G).",
                    ),
                )
                .overrides_with_all([options::size::BLOCK_SIZE, options::size::SI])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::size::KIBIBYTES)
                .short('k')
                .long(options::size::KIBIBYTES)
                .help(
                    ::std::string::String::from(
                        "default to 1024-byte blocks for file system usage; used only with -s and per\ndirectory totals",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::size::SI)
                .long(options::size::SI)
                .help(
                    ::std::string::String::from(
                        "Print human readable file sizes using powers of 1000 instead of 1024.",
                    ),
                )
                .overrides_with_all([
                    options::size::BLOCK_SIZE,
                    options::size::HUMAN_READABLE,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::size::BLOCK_SIZE)
                .long(options::size::BLOCK_SIZE)
                .require_equals(true)
                .value_name("BLOCK_SIZE")
                .help(
                    ::std::string::String::from(
                        "scale sizes by BLOCK_SIZE when printing them",
                    ),
                )
                .overrides_with_all([options::size::SI, options::size::HUMAN_READABLE]),
        )
        .arg(
            Arg::new(options::INODE)
                .short('i')
                .long(options::INODE)
                .help(::std::string::String::from("print the index number of each file"))
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::REVERSE)
                .short('r')
                .long(options::REVERSE)
                .help(
                    ::std::string::String::from(
                        "Reverse whatever the sorting method is e.g., list files in reverse\nalphabetical order, youngest first, smallest first, or whatever.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::RECURSIVE)
                .short('R')
                .long(options::RECURSIVE)
                .help(
                    ::std::string::String::from(
                        "List the contents of all directories recursively.",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::WIDTH)
                .long(options::WIDTH)
                .short('w')
                .help(
                    ::std::string::String::from(
                        "Assume that the terminal is COLS columns wide.",
                    ),
                )
                .value_name("COLS"),
        )
        .arg(
            Arg::new(options::size::ALLOCATION_SIZE)
                .short('s')
                .long(options::size::ALLOCATION_SIZE)
                .help(
                    ::std::string::String::from(
                        "print the allocated size of each file, in blocks",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::COLOR)
                .long(options::COLOR)
                .help(::std::string::String::from("Color output based on file type."))
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        PossibleValue::new("always").alias("yes").alias("force"),
                        PossibleValue::new("auto").alias("tty").alias("if-tty"),
                        PossibleValue::new("never").alias("no").alias("none"),
                    ]),
                )
                .require_equals(true)
                .num_args(0..=1),
        )
        .arg(
            Arg::new(options::INDICATOR_STYLE)
                .long(options::INDICATOR_STYLE)
                .help(
                    ::std::string::String::from(
                        "Append indicator with style WORD to entry names:\nnone (default),  slash (-p), file-type (--file-type), classify (-F)",
                    ),
                )
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        "none",
                        "slash",
                        "file-type",
                        "classify",
                    ]),
                )
                .overrides_with_all([
                    options::indicator_style::FILE_TYPE,
                    options::indicator_style::SLASH,
                    options::indicator_style::CLASSIFY,
                    options::INDICATOR_STYLE,
                ]),
        )
        .arg(
            Arg::new(options::indicator_style::CLASSIFY)
                .short('F')
                .long(options::indicator_style::CLASSIFY)
                .help(
                    ::std::string::String::from(
                        "Append a character to each file name indicating the file type. Also, for\nregular files that are executable, append '*'. The file type indicators are\n'/' for directories, '@' for symbolic links, '|' for FIFOs, '=' for sockets,\n'>' for doors, and nothing for regular files. when may be omitted, or one of:\nnone - Do not classify. This is the default.\nauto - Only classify if standard output is a terminal.\nalways - Always classify.\nSpecifying --classify and no when is equivalent to --classify=always. This will\nnot follow symbolic links listed on the command line unless the\n--dereference-command-line (-H), --dereference (-L), or\n--dereference-command-line-symlink-to-dir options are specified.",
                    ),
                )
                .value_name("when")
                .value_parser(
                    ::clap::builder::PossibleValuesParser::new([
                        PossibleValue::new("always").alias("yes").alias("force"),
                        PossibleValue::new("auto").alias("tty").alias("if-tty"),
                        PossibleValue::new("never").alias("no").alias("none"),
                    ]),
                )
                .default_missing_value("always")
                .require_equals(true)
                .num_args(0..=1)
                .overrides_with_all([
                    options::indicator_style::FILE_TYPE,
                    options::indicator_style::SLASH,
                    options::indicator_style::CLASSIFY,
                    options::INDICATOR_STYLE,
                ]),
        )
        .arg(
            Arg::new(options::indicator_style::FILE_TYPE)
                .long(options::indicator_style::FILE_TYPE)
                .help(
                    ::std::string::String::from(
                        "Same as --classify, but do not append '*'",
                    ),
                )
                .overrides_with_all([
                    options::indicator_style::FILE_TYPE,
                    options::indicator_style::SLASH,
                    options::indicator_style::CLASSIFY,
                    options::INDICATOR_STYLE,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::indicator_style::SLASH)
                .short('p')
                .help(::std::string::String::from("Append / indicator to directories."))
                .overrides_with_all([
                    options::indicator_style::FILE_TYPE,
                    options::indicator_style::SLASH,
                    options::indicator_style::CLASSIFY,
                    options::INDICATOR_STYLE,
                ])
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::TIME_STYLE)
                .long(options::TIME_STYLE)
                .help(
                    ::std::string::String::from(
                        "time/date format with -l; see TIME_STYLE below",
                    ),
                )
                .value_name("TIME_STYLE")
                .value_parser(NonEmptyStringValueParser::new())
                .overrides_with_all([options::TIME_STYLE]),
        )
        .arg(
            Arg::new(options::FULL_TIME)
                .long(options::FULL_TIME)
                .overrides_with(options::FULL_TIME)
                .help(::std::string::String::from("like -l --time-style=full-iso"))
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::CONTEXT)
                .short('Z')
                .long(options::CONTEXT)
                .help(
                    ::std::string::String::from(
                        "print any security context of each file",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::GROUP_DIRECTORIES_FIRST)
                .long(options::GROUP_DIRECTORIES_FIRST)
                .help(
                    ::std::string::String::from(
                        "group directories before files; can be augmented with\na --sort option, but any use of --sort=none (-U) disables grouping",
                    ),
                )
                .action(ArgAction::SetTrue),
        )
        .arg(
            Arg::new(options::PATHS)
                .hide(true)
                .action(ArgAction::Append)
                .value_hint(clap::ValueHint::AnyPath)
                .value_parser(ValueParser::os_string()),
        )
        .after_help(
            ::std::string::String::from(
                "The TIME_STYLE argument can be full-iso, long-iso, iso, locale or +FORMAT. FORMAT is interpreted like in date. Also the TIME_STYLE environment variable sets the default style to use.",
            ),
        )
}