chiark / gitweb /
Break out $edits_sources in command line parser
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Jun 2021 11:44:50 +0000 (12:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 21 Jun 2021 12:01:58 +0000 (13:01 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
nailing-cargo

index 3eb4ee485500ebd161b5fe0a1128eec9bd828800..cc1d9e190e3317149dc566f9641241e0c1febe6c 100755 (executable)
@@ -983,6 +983,10 @@ sub parse_args () {
     $not_a_nailing_opt->() unless m{^-};
     $not_a_nailing_opt->() if $_ eq '--';
 
+    my $edits_sources = sub {
+      $linkfarm_depth = 'copy-edit';
+    };
+
     if ($_ eq '---') { # usage 2 or 3
       if (!@ARGV) {
        die "$self: --- must be followed by build command\n" unless $noact;
@@ -1019,7 +1023,7 @@ sub parse_args () {
        } elsif (s{^-D}{-}) {
          $dump++;
        } elsif (s{^-E}{-}) {
-         $linkfarm_depth = 'copy-edit';
+         $edits_sources->();
        } elsif (s{^-T(.+)}{-}s) {
          $target = $1;
        } elsif (s{^-([oO])}{-}) {
@@ -1044,7 +1048,7 @@ sub parse_args () {
     } elsif (m{^--linkfarm(?:=(no|shallow|git|full))?$}) {
       $linkfarm_depth = $1 || 'git';
     } elsif (m{^--edits?-sources?$}) {
-      $linkfarm_depth = 'copy-edit';
+      $edits_sources->();
     } elsif (m{^--just-run$}) {
       $do_nail = $do_cargo_lock = $do_lock = 0;
     } elsif (m{^--(clean|keep)-linkfarm$}) {