diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-03-25 17:24:51 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-03-25 17:25:19 +0000 |
commit | 4a2fcf2e50ae4a3ef5c0f5b871f475f5ef5f5911 (patch) | |
tree | b0fabb25f26328a16b27b9c903db32d8c49ade82 | |
parent | 1b0f567a014d75482fe8a14a96dc24400a072533 (diff) | |
download | sos-4a2fcf2e50ae4a3ef5c0f5b871f475f5ef5f5911.tar.gz |
Rename --silent to --quiet
'silent' is a poort name for an option that admits to not being
silent:
--silent Only display FATAL errors on stdout
Rename the option to '--quiet' instead and document it in the man
page. It's probably also worth either documenting the fact that
UI text is still printed when --quiet is given in non-batch mode
or changing interactive mode to only print essential prompts when
run with --quiet.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | man/en/sosreport.1 | 3 | ||||
-rw-r--r-- | sos/policies/__init__.py | 6 | ||||
-rw-r--r-- | sos/sosreport.py | 10 |
3 files changed, 11 insertions, 8 deletions
diff --git a/man/en/sosreport.1 b/man/en/sosreport.1 index e28e7581..9f47f3c7 100644 --- a/man/en/sosreport.1 +++ b/man/en/sosreport.1 @@ -45,6 +45,9 @@ Upload the report to Red Hat (use exclusively if advised from a Red Hat support .B \-v, \--verbose Increase the verbosity of the output as sosreport is running. Multiple -v mean more verbosity. .TP +.B \-q, \--quiet +Only log fatal errors to stderr. +.TP .B \--report Enable html/xml report writing .TP diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index a82aa7b8..7e2d3375 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -339,8 +339,8 @@ No changes will be made to system configuration. def _print(self, msg=None): """A wrapper around print that only prints if we are not running in - silent mode""" - if not self.commons['cmdlineopts'].silent: + quiet mode""" + if not self.commons['cmdlineopts'].quiet: if msg: print msg else: @@ -430,7 +430,7 @@ class LinuxPolicy(Policy): localname = self.getLocalName() - if not self.commons['cmdlineopts'].batch and not self.commons['cmdlineopts'].silent: + if not self.commons['cmdlineopts'].batch and not self.commons['cmdlineopts'].quiet: try: self.reportName = raw_input(_("Please enter your first initial and last name [%s]: ") % localname) diff --git a/sos/sosreport.py b/sos/sosreport.py index ef49a09c..c32f7d0b 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -322,7 +322,7 @@ class SoSReport(object): flog.setLevel(logging.INFO) self.soslog.addHandler(flog) - if not self.opts.silent: + if not self.opts.quiet: console = logging.StreamHandler(sys.stderr) console.setFormatter(logging.Formatter('%(message)s')) if self.opts.verbosity > 1: @@ -344,7 +344,7 @@ class SoSReport(object): self.ui_log.addHandler(ui_fhandler) - if not self.opts.silent: + if not self.opts.quiet: ui_console = logging.StreamHandler(sys.stdout) ui_console.setFormatter(logging.Formatter('%(message)s')) ui_console.setLevel(logging.INFO) @@ -641,7 +641,7 @@ class SoSReport(object): for i in izip(self.loaded_plugins): plugruncount += 1 plugname, plug = i[0] - if not self.opts.silent: + if not self.opts.quiet: sys.stdout.write("\r Running %d/%d: %s... " % (plugruncount, len(self.loaded_plugins), plugname)) sys.stdout.flush() try: @@ -822,8 +822,8 @@ class SoSReport(object): parser.add_option("-v", "--verbose", action="count", dest="verbosity", help="increase verbosity") - parser.add_option("", "--silent", action="store_true", - dest="silent", default=False, + parser.add_option("", "--quiet", action="store_true", + dest="quiet", default=False, help="Only display FATAL errors on stdout") parser.add_option("--debug", action="count", dest="debug", |