forked from Imagelibrary/littlefs
Added --color to test.py, fixed some terminal-clobbering issues
With more features being added to test.py, the one-line status is starting to get quite long and pass the ~80 column readability heuristic. To make this worse this clobbers the terminal output when the terminal is not wide enough. Simple solution is to disable line-wrapping, potentially printing some garbage if line-wrapping-disable is not supported, but also printing a final status update to fix any garbage and avoid a race condition where the script would show a non-final status. Also added --color which disables any of this attempting-to-be-clever stuff.
This commit is contained in:
@@ -503,7 +503,6 @@ if __name__ == "__main__":
|
||||
help="Show a additional lines of context. Defaults to 3.")
|
||||
parser.add_argument('-w', '--width', type=lambda x: int(x, 0), default=80,
|
||||
help="Assume source is styled with this many columns. Defaults to 80.")
|
||||
# TODO add this to test.py?
|
||||
parser.add_argument('--color',
|
||||
choices=['never', 'always', 'auto'], default='auto',
|
||||
help="When to use terminal colors.")
|
||||
|
||||
Reference in New Issue
Block a user