From: Ian Jackson Date: Sat, 10 Oct 2020 15:50:24 +0000 (+0100) Subject: Get options right for "cargo fmt" X-Git-Tag: nailing-cargo/1.0.0~41 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=08354d92e55c8ac9d567fd97bdfc9192e3268077;p=nailing-cargo.git Get options right for "cargo fmt" Signed-off-by: Ian Jackson --- diff --git a/nailing-cargo b/nailing-cargo index 731ef5c..e06a8a6 100755 --- a/nailing-cargo +++ b/nailing-cargo @@ -101,13 +101,14 @@ our $linkfarm_depth; # our %subcmd_props = ( -# build (default) =>[qw( )], -'generate-lockfile'=>[qw( lock-update !target !target-dir )], - update =>[qw( lock-update !target online )], - fetch =>[qw( online !target-dir )], +# build (default) =>[qw( )], +'generate-lockfile'=>[qw( lock-update !target !target-dir )], + update =>[qw( lock-update !target online )], + fetch =>[qw( online !target-dir )], + fmt =>[qw( !locked !target !offline !target-dir edits )], ); -our @subcmd_xprops = qw(!manifest-path !offline !locked); +our @subcmd_xprops = qw(!manifest-path); our @configs; our $verbose=1; @@ -594,6 +595,11 @@ sub addargs () { push @add, "--offline" unless $online || subcmd_p('!offline'); + if (subcmd_p('edits') && $linkfarm_depth ne 'copy-edit') { + print STDERR + "$self: *WARNING*: this subcommand expects to edit the source code; you probably want to specify --edits-sources aka -E (which is not the default even now, for safety reasons)\n"; + } + push @args_preface, @add if $pass_options; die if grep { m/ / } @add; $ENV{NAILINGCARGO_CARGO_OPTIONS} = "@add";