mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-22 21:05:30 +00:00
Add --version option based on git describe
This commit is contained in:
parent
c9e3b8224a
commit
8709c8a8ee
5 changed files with 18 additions and 3 deletions
|
@ -25,9 +25,12 @@ from sby_jobserver import SbyJobClient, process_jobserver_environment
|
|||
from sby_status import SbyStatusDb
|
||||
import time, platform, click
|
||||
|
||||
release_version = 'unknown SBY version'
|
||||
##yosys-release-version##
|
||||
|
||||
process_jobserver_environment() # needs to be called early
|
||||
|
||||
parser = parser_func()
|
||||
parser = parser_func(release_version)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ class DictAction(argparse.Action):
|
|||
name = option_string.lstrip(parser.prefix_chars).replace("-", "_")
|
||||
getattr(namespace, self.dest)[name] = values
|
||||
|
||||
def parser_func():
|
||||
def parser_func(release_version='unknown SBY version'):
|
||||
parser = argparse.ArgumentParser(prog="sby",
|
||||
usage="%(prog)s [options] [<jobname>.sby [tasknames] | <dirname>]")
|
||||
parser.set_defaults(exe_paths=dict())
|
||||
|
@ -81,4 +81,6 @@ def parser_func():
|
|||
parser.add_argument("arg_tasknames", metavar="tasknames", nargs="*",
|
||||
help="tasks to run (only valid when <jobname>.sby is used)")
|
||||
|
||||
parser.add_argument('--version', action='version', version=release_version)
|
||||
|
||||
return parser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue