+
+ # --no-(local|remote) CLI flags overrided saved `lei.q.only'
+ my $only = $lei->{opt}->{only};
+ @$only = map { $lei->get_externals($_) } @$only if $only;
+ if (scalar keys %no && $only) {
+ @$only = grep(!m!\Ahttps?://!i, @$only) if $no{remote};
+ @$only = grep(m!\Ahttps?://!i, @$only) if $no{'local'};
+ }
+ if ($cli_exclude) {
+ my $ex = $lei->canonicalize_excludes($cli_exclude);
+ @$only = grep { !$ex->{$_} } @$only if $only;
+ push @{$lei->{opt}->{exclude}}, @$cli_exclude;
+ }
+ delete $lei->{opt}->{only} if $no{external} || ($only && !@$only);