1 use std::path::PathBuf;
3 use clap::{Parser, ValueHint};
5 // Command line options
6 /// A command-line utility for easily compressing and decompressing files and directories.
8 /// Supported formats: tar, zip, bz/bz2, gz, lz4, xz/lz/lzma, zst.
10 /// Repository: https://github.com/ouch-org/ouch
11 #[derive(Parser, Debug)]
12 #[clap(about, version)]
13 // Ignore bare urls in the documentation of this file because the doc comments
14 // are also being used by Clap's --help generation
15 #[allow(rustdoc::bare_urls)]
17 /// Skip [Y/n] questions positively.
18 #[clap(short, long, conflicts_with = "no", global = true)]
21 /// Skip [Y/n] questions negatively.
22 #[clap(short, long, global = true)]
25 /// Activate accessibility mode, reducing visual noise
26 #[clap(short = 'A', long, env = "ACCESSIBLE", global = true)]
29 /// Ignores hidden files
30 #[clap(short = 'H', long)]
33 /// Ignores files matched by git's ignore files
34 #[clap(short = 'g', long)]
37 /// Ouch and claps subcommands
42 // CAREFUL: this docs can accidentally become part of the --help message if they get too long
43 // this was tested in clap 3.0.0-beta5.
44 /// Repository: https://github.com/ouch-org/ouch
53 #[derive(Parser, PartialEq, Eq, Debug)]
54 #[allow(rustdoc::bare_urls)]
56 /// Compress one or more files into one output file.
59 /// Files to be compressed.
60 #[clap(required = true, min_values = 1)]
63 /// The resulting file. Its extensions can be used to specify the compression formats.
64 #[clap(required = true, value_hint = ValueHint::FilePath)]
67 /// Decompresses one or more files, optionally into another folder.
70 /// Files to be decompressed.
71 #[clap(required = true, min_values = 1)]
74 /// Place results in a directory other than the current one.
75 #[clap(short = 'd', long = "dir", value_hint = ValueHint::DirPath)]
76 output_dir: Option<PathBuf>,
78 /// List contents. Alias: l
81 /// Archives whose contents should be listed
82 #[clap(required = true, min_values = 1)]
83 archives: Vec<PathBuf>,
85 /// Show archive contents as a tree