Commit 4edfb006 authored by Salvatore Bonaccorso's avatar Salvatore Bonaccorso

patchedit: Avoid given/when construct

As given/when feature is marked as experimental with Perl 5.18 avoid
this construct by switching back to conventional if cascade.
parent ccbbf03b
......@@ -152,19 +152,15 @@ sub main {
foreach my $patch_file (@patch_files) {
die 'no such file "'.$patch_file.'"'
if not -f $patch_file;
given ($cmd) {
when ('edit') {
fix_patch($patch_file, $also_optional)
if $do_fix;
edit_patch($patch_file);
}
when ('check') {
check_patch($patch_file, $also_optional);
fix_patch($patch_file, $also_optional)
if $do_fix;
}
}
if ($cmd eq 'edit') {
fix_patch($patch_file, $also_optional) if $do_fix;
edit_patch($patch_file);
}
elsif ($cmd eq 'check') {
check_patch($patch_file, $also_optional);
fix_patch($patch_file, $also_optional) if $do_fix;
}
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment