Skip to content

Commit 61a4e8e

Browse files
committed
Fix cat command
1 parent f0eae49 commit 61a4e8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/pavilion/commands/cat.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self):
2424
def _setup_arguments(self, parser):
2525
parser.add_argument(
2626
'test_id', help="test id",
27+
nargs='?', default=None,
2728
metavar='TEST_ID'
2829
)
2930
parser.add_argument(
@@ -38,6 +39,10 @@ def run(self, pav_cfg, args):
3839

3940
if args.test_id is None:
4041
test_id = cmd_utils.get_last_test_id(pav_cfg, self.errfile)
42+
43+
if test_id is None:
44+
output.fprint(self.errfile, "No last test found.", color=output.RED)
45+
return 1
4146
elif TestID.is_valid_id(args.test_id):
4247
test_id = TestID(args.test_id)
4348
else:

0 commit comments

Comments
 (0)