Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix --reinstall option on source command
The `--reinstall` option when running the source command now correctly
implies the `--relock` option as well.
  • Loading branch information
rossmacarthur committed May 11, 2020
1 parent eb6aaf4 commit 081f940
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/cli.rs
Expand Up @@ -119,13 +119,12 @@ enum RawCommand {
/// Generate and print out the script.
#[structopt(help_message = HELP_MESSAGE)]
Source {
/// Reinstall all plugin sources.
#[structopt(long)]
reinstall: bool,

/// Regenerate the lock file.
#[structopt(long)]
relock: bool,
/// Reinstall all plugin sources (implies --relock).
#[structopt(long)]
reinstall: bool,
},
}

Expand Down Expand Up @@ -321,7 +320,10 @@ impl Opt {
RawCommand::Edit => Command::Edit,
RawCommand::Remove { name } => Command::Remove { name },
RawCommand::Lock { reinstall } => Command::Lock { reinstall },
RawCommand::Source { reinstall, relock } => Command::Source { reinstall, relock },
RawCommand::Source { relock, reinstall } => Command::Source {
relock: relock || reinstall,
reinstall,
},
};

Self {
Expand Down Expand Up @@ -892,8 +894,8 @@ USAGE:
{name} source [FLAGS]
FLAGS:
--reinstall Reinstall all plugin sources
--relock Regenerate the lock file
--reinstall Reinstall all plugin sources (implies --relock)
-h, --help Show this message and exit",
name = crate_name!(),
version = crate_version!()
Expand Down

0 comments on commit 081f940

Please sign in to comment.