virtual-appliance/scripts/print

22 lines
308 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env python3
import sys
TTY = sys.stdout.isatty()
write = sys.stdout.write
write('\n')
if TTY:
write('\x1b[') # escape, left-bracket
write('1;31m') # bold red
write(' '.join(sys.argv[1:]))
if TTY:
write('\x1b[') # escape, left-bracket
write('0m') # reset
write('\n')