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)]
14 /// Skip [Y/n] questions positively.
15 #[clap(short, long, conflicts_with = "no")]
18 /// Skip [Y/n] questions negatively.
22 /// Activate accessibility mode, reducing visual noise
23 #[clap(short = 'A', long, env = "ACCESSIBLE")]
26 /// Ouch and claps subcommands
31 // CAREFUL: this docs can accidentally become part of the --help message if they get too long
32 // this was tested in clap 3.0.0-beta5.
33 /// Repository: https://github.com/ouch-org/ouch
42 #[derive(Parser, PartialEq, Eq, Debug)]
44 /// Compress one or more files into one output file.
47 /// Files to be compressed.
48 #[clap(required = true, min_values = 1)]
51 /// The resulting file. Its extensions can be used to specify the compression formats.
52 #[clap(required = true, value_hint = ValueHint::FilePath)]
55 /// Decompresses one or more files, optionally into another folder.
58 /// Files to be decompressed.
59 #[clap(required = true, min_values = 1)]
62 /// Choose to files in a directory other than the current
63 #[clap(short = 'd', long = "dir", value_hint = ValueHint::DirPath)]
64 output_dir: Option<PathBuf>,
66 /// List contents. Alias: l
69 /// Archives whose contents should be listed
70 #[clap(required = true, min_values = 1)]
71 archives: Vec<PathBuf>,
73 /// Show archive contents as a tree