Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add force color option for Salt outputters #237

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pepper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ def parse(self):
''')
)

self.parser.add_option(
'--output-force-color', dest='output_force_color', default=False, action='store_true',
help=textwrap.dedent('''
Force salt outputter to use color when printing.
''')
)

self.parser.add_option(
'--output-file', dest='output_file', default=None,
help=textwrap.dedent('''
Expand Down
2 changes: 2 additions & 0 deletions pepper/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def __init__(self):
self.cli = PepperCli()
if HAS_SALT:
self.opts = salt.config.client_config(self.cli.options.master)
if self.cli.options.output_force_color:
self.opts['color'] = True
else:
self.opts = {}
if self.cli.options.output_file is not None:
Expand Down