From 4a81724e95bc54e6c5433338bff8b3df5cd18350 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 25 Jul 2020 18:49:57 +0100 Subject: [PATCH] nailing-cargo: Tolerate lack of build commands with -n We just use dummy values instead. Signed-off-by: Ian Jackson --- nailing-cargo | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nailing-cargo b/nailing-cargo index 98436be..370fa05 100755 --- a/nailing-cargo +++ b/nailing-cargo @@ -845,7 +845,10 @@ sub parse_args () { # $is_cargo==0 ... OPTS: for (;;) { - @ARGV or die "$self: need cargo subcommand\n"; + if (!@ARGV) { + die "$self: need cargo subcommand\n" unless $noact; + push @ARGV, "CARGO-SUBCOMMAND"; # dummy, user may see it + } $_ = shift @ARGV; my $orgopt = $_; @@ -861,7 +864,10 @@ sub parse_args () { $not_a_nailing_opt->() if $_ eq '--'; if ($_ eq '---') { # usage 2 or 3 - die "$self: --- must be followed by build command\n" unless @ARGV; + if (!@ARGV) { + die "$self: --- must be followed by build command\n" unless $noact; + push @ARGV, 'BUILD-COMMAND'; + } if ($ARGV[0] eq '--') { # usage 3 shift; $is_cargo = 0; -- 2.30.2