Skip to content

Commit 3fa32ef

Browse files
committed
fix(rebase-snap): Move deprecation message
Commit ded9038 ("deprecation(rebase-snap): marked rebase-snap as deprecated") breaks our release process, because it shows the deprecation message before the version info and the release script gets the version from the first line. This commit moves the deprecation message not to come before the version info. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 07e287f commit 3fa32ef

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/rebase-snap/src/main.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use utils::u64_to_usize;
1313
const REBASE_SNAP_VERSION: &str = env!("CARGO_PKG_VERSION");
1414
const BASE_FILE: &str = "base-file";
1515
const DIFF_FILE: &str = "diff-file";
16+
const DEPRECATION_MSG: &str = "This tool is deprecated and will be removed in the future. Please \
17+
use 'snapshot-editor' instead.\n";
1618

1719
#[derive(Debug, thiserror::Error, displaydoc::Display)]
1820
enum FileError {
@@ -115,10 +117,6 @@ fn rebase(base_file: &mut File, diff_file: &mut File) -> Result<(), FileError> {
115117
}
116118

117119
fn main() -> Result<(), RebaseSnapError> {
118-
println!(
119-
"This tool is deprecated and will be removed in the future. Please use 'snapshot-editor' \
120-
instead."
121-
);
122120
let result = main_exec();
123121
if let Err(e) = result {
124122
eprintln!("{}", e);
@@ -139,16 +137,18 @@ fn main_exec() -> Result<(), RebaseSnapError> {
139137
if arguments.flag_present("help") {
140138
println!("Rebase_snap v{}", REBASE_SNAP_VERSION);
141139
println!(
142-
"Tool that copies all the non-sparse sections from a diff file onto a base file\n"
140+
"Tool that copies all the non-sparse sections from a diff file onto a base file.\n"
143141
);
142+
println!("{DEPRECATION_MSG}");
144143
println!("{}", arg_parser.formatted_help());
145144
return Ok(());
146145
}
147146
if arguments.flag_present("version") {
148-
println!("Rebase_snap v{}\n", REBASE_SNAP_VERSION);
147+
println!("Rebase_snap v{REBASE_SNAP_VERSION}\n{DEPRECATION_MSG}");
149148
return Ok(());
150149
}
151150

151+
println!("{DEPRECATION_MSG}");
152152
let (mut base_file, mut diff_file) = get_files(arguments).map_err(RebaseSnapError::SnapFile)?;
153153

154154
rebase(&mut base_file, &mut diff_file).map_err(RebaseSnapError::RebaseFiles)?;

0 commit comments

Comments
 (0)