chdist: Allow putting the dist name before the command instead of after

This is a lot more intuitive than the current system of having it beforehand.
parent 3d231641
Pipeline #66223 failed with stage
in 14 minutes and 16 seconds
......@@ -57,6 +57,10 @@ devscripts (2.19.7) UNRELEASED; urgency=medium
* dcontrol: Remove, the backend on qa.debian.org has not been maintained for
years.
[ Paul Wise ]
* chdist:
+ Allow putting the dist name before the command instead of after
-- Mattia Rizzolo <mattia@debian.org> Mon, 22 Jul 2019 08:15:08 +0200
devscripts (2.19.6) unstable; urgency=medium
......
......@@ -706,6 +706,8 @@ sub parseFile {
### Command parsing
########################################################
my $recursed = 0;
MAIN:
my $command = shift @ARGV;
given ($command) {
when ('create') {
......@@ -763,6 +765,16 @@ given ($command) {
list;
}
default {
usage(1);
my $dist = $command;
my $dir = "$datadir/$dist";
if (-d $dir && !$recursed) {
splice @ARGV, 1, 0, $dist;
$recursed = 1;
goto MAIN;
} elsif ($dist && !$recursed) {
dist_check($dist);
} else {
usage(1);
}
}
}
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