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)]
14 /// Skip [Y/n] questions positively.
15 #[clap(short, long, conflicts_with = "no", global = true)]
18 /// Skip [Y/n] questions negatively.
19 #[clap(short, long, global = true)]
22 /// Activate accessibility mode, reducing visual noise
23 #[clap(short = 'A', long, env = "ACCESSIBLE", global = true)]
26 /// Ignores hidden files
27 #[clap(short = 'H', long)]
30 /// Ignores files matched by git's ignore files
31 #[clap(short = 'g', long)]
34 /// Ouch and claps subcommands
39 // CAREFUL: this docs can accidentally become part of the --help message if they get too long
40 // this was tested in clap 3.0.0-beta5.
41 /// Repository: https://github.com/ouch-org/ouch
50 #[derive(Parser, PartialEq, Eq, Debug)]
52 /// Compress one or more files into one output file.
55 /// Files to be compressed.
56 #[clap(required = true, min_values = 1)]
59 /// The resulting file. Its extensions can be used to specify the compression formats.
60 #[clap(required = true, value_hint = ValueHint::FilePath)]
63 /// Decompresses one or more files, optionally into another folder.
66 /// Files to be decompressed.
67 #[clap(required = true, min_values = 1)]
70 /// Choose to files in a directory other than the current
71 #[clap(short = 'd', long = "dir", value_hint = ValueHint::DirPath)]
72 output_dir: Option<PathBuf>,
74 /// List contents. Alias: l
77 /// Archives whose contents should be listed
78 #[clap(required = true, min_values = 1)]
79 archives: Vec<PathBuf>,
81 /// Show archive contents as a tree