Skip to content

Commit 9b9f781

Browse files
Stephan SokolowStephan Sokolow
Stephan Sokolow
authored and
Stephan Sokolow
committed
Rename Opt to CliOpts to better fit my conventions
1 parent 805a3e5 commit 9b9f781

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use validators::path_readable;
5454
#[structopt(author="", rename_all = "kebab-case",
5555
long_about = "\nTODO: Replace me with the description text for the command",
5656
raw(setting = "structopt::clap::AppSettings::ColoredHelp"))]
57-
struct Opt {
57+
struct CliOpts {
5858
/// Decrease verbosity (-q, -qq, -qqq, etc.)
5959
#[structopt(short, long, parse(from_occurrences))]
6060
quiet: usize,
@@ -83,7 +83,7 @@ struct Opt {
8383
/// having to put the error message pretty-printing inside main()
8484
fn main() {
8585
// Parse command-line arguments (exiting on parse error, --version, or --help)
86-
let opts = Opt::from_args();
86+
let opts = CliOpts::from_args();
8787

8888
// Configure logging output so that -q is "decrease verbosity" rather than instant silence
8989
let verbosity = (opts.verbose.saturating_add(DEFAULT_VERBOSITY)).saturating_sub(opts.quiet);
@@ -97,8 +97,8 @@ fn main() {
9797

9898
// If requested, generate shell completions and then exit with status of "success"
9999
if let Some(shell) = opts.dump_completions {
100-
Opt::clap().gen_completions_to(
101-
Opt::clap().get_bin_name().unwrap_or_else(|| clap::crate_name!()),
100+
CliOpts::clap().gen_completions_to(
101+
CliOpts::clap().get_bin_name().unwrap_or_else(|| clap::crate_name!()),
102102
shell,
103103
&mut io::stdout());
104104
std::process::exit(0);
@@ -121,7 +121,7 @@ fn main() {
121121
}
122122

123123
/// The actual `main()`
124-
fn run(opts: Opt) -> Result<()> {
124+
fn run(opts: CliOpts) -> Result<()> {
125125
for inpath in opts.inpath {
126126
unimplemented!()
127127
}
@@ -132,7 +132,7 @@ fn run(opts: Opt) -> Result<()> {
132132
// Tests go below the code where they'll be out of the way when not the target of attention
133133
#[cfg(test)]
134134
mod tests {
135-
// use super::Opt;
135+
// use super::CliOpts;
136136

137137
#[test]
138138
/// Test something

0 commit comments

Comments
 (0)