[munin/link_plugins.py] ajout de l'option de verbosité
je n'avais pas vu que optparse était utilisé darcs-hash:20090421221235-bd074-0e649563fb46a2428f436232f110bdf4ceac953f.gz
This commit is contained in:
parent
7e7fb2e304
commit
49e39e4a85
1 changed files with 5 additions and 1 deletions
|
@ -128,7 +128,7 @@ def link_plugins(plugins, directory):
|
||||||
for name, path in plugins.iteritems():
|
for name, path in plugins.iteritems():
|
||||||
try:
|
try:
|
||||||
os.symlink(path, os.path.join(directory, name))
|
os.symlink(path, os.path.join(directory, name))
|
||||||
if sys.argv[1] == '-v':
|
if options.verbose:
|
||||||
print "%s installé avec succès!" % name
|
print "%s installé avec succès!" % name
|
||||||
except OSError:
|
except OSError:
|
||||||
print "Echec à l'installation de %s (déjà installé?)" % name
|
print "Echec à l'installation de %s (déjà installé?)" % name
|
||||||
|
@ -203,6 +203,10 @@ if __name__ == "__main__":
|
||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
help = 'Do not actually make links'
|
help = 'Do not actually make links'
|
||||||
)
|
)
|
||||||
|
parser.add_option('-v', '--verbose',
|
||||||
|
action = 'store_true',
|
||||||
|
help = 'Increase verbosity'
|
||||||
|
)
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
plugins = get_all_plugins()
|
plugins = get_all_plugins()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue