Skip to content

Commit

Permalink
#227 New option --include-version
Browse files Browse the repository at this point in the history
Show version and continue as normal: helpful to debug CI issues.
  • Loading branch information
florianschanda committed Aug 6, 2021
1 parent e4ed08d commit 70a8bb3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Not quite compatible with Octave yet. See #43 [octave support](https://github.co

### 0.9.26-dev


* All tools have a new common option `--include-version`, which will
print the MISS_HIT version similar to `--version`; but will continue
execution. This is helpful to debug e.g. CI issues.

### 0.9.25

Expand Down
7 changes: 7 additions & 0 deletions docs/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ <h4>--version</h4>
Displays tool version and quits.
</div>

<h4>--include-version</h4>
<div>
Show the tool version as the very first thing, but continue
running as normal. This is helpful when debugging e.g. CI
issues.
</div>

<h4>FILE | DIRECTORY</h4>
<div>
Can be specified more than once. Causes tool to analyze the
Expand Down
10 changes: 8 additions & 2 deletions miss_hit_core/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ def create_basic_clp(epilog=None):
action="store_true",
default=False,
help="Show version and exit")
ap.add_argument("--include-version",
action="store_true",
default=False,
help=("Include version number in output, can helpful to"
" debug CI issues"))
ap.add_argument("files",
metavar="FILE|DIR",
nargs="*",
Expand Down Expand Up @@ -118,9 +123,10 @@ def create_basic_clp(epilog=None):
def parse_args(clp):
options = clp["ap"].parse_args()

if options.version:
if options.version or options.include_version:
print(FULL_NAME)
sys.exit(0)
if options.version:
sys.exit(0)

# False alarm from pylint
# pylint: disable=no-member
Expand Down

0 comments on commit 70a8bb3

Please sign in to comment.