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 CLI options for highstate formatter modes #1

Merged
merged 1 commit into from
Jul 29, 2021
Merged
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
15 changes: 15 additions & 0 deletions pepper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ def parse(self):
''')
)

self.parser.add_option(
'--state-output', dest='state_output', default="full", type="choice",
choices = [ "full", "terse", "mixed", "changes", "filter" ],
help=textwrap.dedent('''
Output mode for highstate formatter
''')
)

self.parser.add_option(
'--state-verbose', dest='state_verbose', default=None,
help=textwrap.dedent('''
Set to false to hide results with no changes
''')
)

self.parser.add_option(
'--output-file', dest='output_file', default=None,
help=textwrap.dedent('''
Expand Down
5 changes: 5 additions & 0 deletions pepper/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def __init__(self):
self.opts = {}
if self.cli.options.output_file is not None:
self.opts['output_file'] = self.cli.options.output_file
if self.cli.options.state_output is not None:
self.opts['state_output'] = self.cli.options.state_output
if self.cli.options.state_verbose is not None:
self.opts['state_verbose'] = self.cli.options.state_verbose in [ "true", "True", "1" ]


@property
def output(self):
Expand Down