Skip to content

Commit

Permalink
Added --version command line option
Browse files Browse the repository at this point in the history
Fixes #300
  • Loading branch information
set-soft authored and qu1ck committed May 20, 2022
1 parent fdf59d8 commit 356c4a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions InteractiveHtmlBom/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,12 @@ def safe_set_checked_strings(clb, strings):
dlg.finish_init()

@classmethod
def add_options(cls, parser):
# type: (argparse.ArgumentParser) -> None
def add_options(cls, parser, version):
# type: (argparse.ArgumentParser, str) -> None
parser.add_argument('--show-dialog', action='store_true',
help='Shows config dialog. All other flags '
'will be ignored.')
parser.add_argument('--version', action='version', version=version)
# Html
parser.add_argument('--dark-mode', help='Default to dark mode.',
action='store_true')
Expand Down
2 changes: 1 addition & 1 deletion InteractiveHtmlBom/generate_interactive_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def to_utf(s):
type=lambda s: to_utf(s),
help="KiCad PCB file")

Config.add_options(parser)
Config.add_options(parser, version)
args = parser.parse_args()
logger = ibom.Logger(cli=True)

Expand Down

0 comments on commit 356c4a2

Please sign in to comment.