Skip to content

Commit

Permalink
Merge pull request #1 from ahktenzero/develop
Browse files Browse the repository at this point in the history
Add CLI options for highstate formatter modes
  • Loading branch information
eliasp authored Jul 29, 2021
2 parents 8096e08 + 17d1fd8 commit 0958404
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
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

0 comments on commit 0958404

Please sign in to comment.