From 458bbe750abd279dc9749b824a986a73f0cffafd Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 27 Jul 2004 02:25:26 +0000 Subject: Add options -q and -v (quiet and verbose) to urpmi.{add,remove}media --- urpmi.removemedia | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'urpmi.removemedia') diff --git a/urpmi.removemedia b/urpmi.removemedia index 9ac8f913..4a2d9e25 100755 --- a/urpmi.removemedia +++ b/urpmi.removemedia @@ -29,16 +29,21 @@ sub main { $options{noclean} = 1; $options{strict_match} = 1; + $options{verbose} = 1; foreach (@_) { /^--?a$/ and $options{all} = 1, next; /^--?c$/ and $options{noclean} = 0, next; /^--?y$/ and $options{strict_match} = 0, next; + /^--?v$/ and $options{verbose} = 1, next; + /^--?q$/ and $options{verbose} = 0, next; /^-/ and die N("usage: urpmi.removemedia [-a] ... where is a medium name to remove. ") . N(" --help - print this help message. ") . N(" -a - select all media. ") . N(" -c - clean headers cache directory. ") . N(" -y - fuzzy match on media names. +") . N(" -q - quiet mode. +") . N(" -v - verbose mode. ") . (/^--?h(?:elp)$/ ? '' : N("\nunknown options '%s'\n", $_)); push @toremoves, $_; } @@ -47,6 +52,9 @@ where is a medium name to remove. if ($< != 0) { $urpm->{fatal}(1, N("Only superuser is allowed to remove media")); } + + $options{verbose} > 0 or $urpm->{log} = sub {}; + $urpm->read_config; my @entries = map { $_->{name} } @{$urpm->{media}}; -- cgit v1.2.1