Skip to content
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(
'--force-color', '--force-colour', dest='output_force_color', default=False, action='store_true',
help=textwrap.dedent('''
Force salt outputter to use color when printing.
''')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have options match the salt command where possible:

    --force-color, --force-colour
                        Force colored output.

Would you be OK with updating that to support --force-color and --force-colour?
If so, probably best to also update the var to force_color

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

)

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