Skip to content

Commit a6c9403

Browse files
author
Olli-Pekka Puolitaival
committed
Print tip only if verbose it not used
1 parent 781e147 commit a6c9403

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mbed/mbed.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -3431,22 +3431,23 @@ def main():
34313431
pargs, remainder = parser.parse_known_args()
34323432
status = 1
34333433

3434+
very_verbose = pargs.very_verbose
3435+
verbose = very_verbose or pargs.verbose
34343436
try:
3435-
very_verbose = pargs.very_verbose
3436-
verbose = very_verbose or pargs.verbose
34373437
pathtype = Repo.pathtype(cwd_root)
34383438
if not sys.argv[1].lower() in skip_workpath_commands:
34393439
action('Working path \"%s\" (%s)' % (cwd_root, pathtype))
34403440
if pathtype == "library":
34413441
action('Program path \"%s\"' % Program(cwd_root).path)
34423442
status = pargs.command(pargs)
34433443
except ProcessException as e:
3444+
tip = "" if verbose else "\nTip: You could retry the last command with \"-v\" flag for verbose output\n"
3445+
34443446
error(
34453447
"\"%s\" returned error.\n"
34463448
"Code: %d\n"
34473449
"Path: \"%s\"\n"
3448-
"Command: \"%s\"\n"
3449-
"Tip: You could retry the last command with \"-v\" flag for verbose output\n" % (e.args[1], e.args[0], e.args[3], e.args[2]), e.args[0])
3450+
"Command: \"%s\"%s" % (e.args[1], e.args[0], e.args[3], e.args[2], tip))
34503451
except OSError as e:
34513452
if e.args[0] == errno.ENOENT:
34523453
error(

0 commit comments

Comments
 (0)