mirror of
https://github.com/YosysHQ/sby.git
synced 2025-04-12 08:28:16 +00:00
Merge pull request #267 from jix/sby-status-errormsg
Improved CLI behavior when not specifying a config or existing workdir
This commit is contained in:
commit
c73cd3eeea
|
@ -61,6 +61,9 @@ status_reset = args.status_reset
|
||||||
|
|
||||||
if status_show or status_reset:
|
if status_show or status_reset:
|
||||||
target = workdir_prefix or workdir or sbyfile
|
target = workdir_prefix or workdir or sbyfile
|
||||||
|
if target is None:
|
||||||
|
print("ERROR: Specify a .sby config file or working directory to use --status.")
|
||||||
|
sys.exit(1)
|
||||||
if not os.path.isdir(target) and target.endswith('.sby'):
|
if not os.path.isdir(target) and target.endswith('.sby'):
|
||||||
target = target[:-4]
|
target = target[:-4]
|
||||||
if not os.path.isdir(target):
|
if not os.path.isdir(target):
|
||||||
|
@ -294,6 +297,8 @@ def read_sbyconfig(sbydata, taskname):
|
||||||
|
|
||||||
|
|
||||||
sbydata = list()
|
sbydata = list()
|
||||||
|
if sbyfile is None:
|
||||||
|
print("Reading .sby configuration from stdin:")
|
||||||
with (open(sbyfile, "r") if sbyfile is not None else sys.stdin) as f:
|
with (open(sbyfile, "r") if sbyfile is not None else sys.stdin) as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
sbydata.append(line)
|
sbydata.append(line)
|
||||||
|
|
Loading…
Reference in a new issue