Skip to content

Commit 081f940

Browse files
committed
Fix --reinstall option on source command
The `--reinstall` option when running the source command now correctly implies the `--relock` option as well.
1 parent eb6aaf4 commit 081f940

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎src/cli.rs‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,12 @@ enum RawCommand {
119119
/// Generate and print out the script.
120120
#[structopt(help_message = HELP_MESSAGE)]
121121
Source {
122-
/// Reinstall all plugin sources.
123-
#[structopt(long)]
124-
reinstall: bool,
125-
126122
/// Regenerate the lock file.
127123
#[structopt(long)]
128124
relock: bool,
125+
/// Reinstall all plugin sources (implies --relock).
126+
#[structopt(long)]
127+
reinstall: bool,
129128
},
130129
}
131130

@@ -321,7 +320,10 @@ impl Opt {
321320
RawCommand::Edit => Command::Edit,
322321
RawCommand::Remove { name } => Command::Remove { name },
323322
RawCommand::Lock { reinstall } => Command::Lock { reinstall },
324-
RawCommand::Source { reinstall, relock } => Command::Source { reinstall, relock },
323+
RawCommand::Source { relock, reinstall } => Command::Source {
324+
relock: relock || reinstall,
325+
reinstall,
326+
},
325327
};
326328

327329
Self {
@@ -892,8 +894,8 @@ USAGE:
892894
{name} source [FLAGS]
893895
894896
FLAGS:
895-
--reinstall Reinstall all plugin sources
896897
--relock Regenerate the lock file
898+
--reinstall Reinstall all plugin sources (implies --relock)
897899
-h, --help Show this message and exit",
898900
name = crate_name!(),
899901
version = crate_version!()

0 commit comments

Comments
 (0)