diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-03-04 13:43:42 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-03-04 13:43:42 +0000 |
commit | b1c11ca78832a68f63ad07d7e7c70d30be96472a (patch) | |
tree | 30e37e86687bef247e961ec81dc155c6a566dd83 /urpm | |
parent | c074b7e932bb6d457a693f4c4f8ba9089a25b7c3 (diff) | |
download | urpmi-b1c11ca78832a68f63ad07d7e7c70d30be96472a.tar urpmi-b1c11ca78832a68f63ad07d7e7c70d30be96472a.tar.gz urpmi-b1c11ca78832a68f63ad07d7e7c70d30be96472a.tar.bz2 urpmi-b1c11ca78832a68f63ad07d7e7c70d30be96472a.tar.xz urpmi-b1c11ca78832a68f63ad07d7e7c70d30be96472a.zip |
factorize common options between urpmi & gurpmi
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/args.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/urpm/args.pm b/urpm/args.pm index 783a9ff4..5477a8ca 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -61,17 +61,9 @@ my %options_spec = ( # warning: for gurpm, urpm is _not_ a real urpmi object, only options should be altered: gurpmi => { - auto => sub { $urpm->{options}{auto} = 1 }, - 'auto-select' => \$::auto_select, - # actually ignored (only for compat with do_pkgs), copy_removable() callback is always given: - 'allow-medium-change' => \$::allow_medium_change, - 'expect-install!' => \$::urpm::main_loop::expect_install, 'media|mediums=s' => sub { $urpm->{options}{media} = 1 }, "help|h" => sub { gurpmi::usage() }, - 'root=s' => sub { set_root($urpm, $_[1]) }, 'searchmedia|search-media=s' => sub { $urpm->{options}{searchmedia} = 1 }, - 'test!' => \$::test, - 'verify-rpm!' => sub { $urpm->{options}{'verify-rpm'} = $_[1] }, }, urpmi => { @@ -353,7 +345,6 @@ my %options_spec = ( ); -$options_spec{gurpmi2} = $options_spec{gurpmi}; # generate urpmf options callbacks @@ -379,6 +370,12 @@ sub add_urpmf_parameter { # common options setup +foreach my $k ('allow-medium-change', 'auto', 'auto-select', 'expect-install!', 'root=s', 'test!', 'verify-rpm!') +{ + $options_spec{gurpmi}{$k} = $options_spec{urpmi}{$k}; +} +$options_spec{gurpmi2} = $options_spec{gurpmi}; + foreach my $k ("help|h", "version", "no-locales", "test!", "force", "root=s", "use-distrib=s", "parallel=s") { |