Ignore:
Timestamp:
10/06/16 21:10:15 (8 years ago)
Author:
tim
Message:

256 color now default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/bletchley-analyze

    r77 r115  
    4444parser.add_argument('-p', dest='output_lines', type=int, default=10,
    4545                    help='Number of lines of input to display in decoded form.')
     46parser.add_argument('-C', action='store_const', const=True, default=False,
     47                    help='Use mono output for decoded highlights.')
    4648parser.add_argument('-c', action='store_const', const=True, default=False,
    47                     help='Use color output for decoded highlights.')
    48 parser.add_argument('-c256', action='store_const', const=True, default=False,
    49                     help='Use 256 color output for decoded highlights.')
     49                    help='Use 8 color output for decoded highlights.')
     50parser.add_argument('-c256', action='store_const', const=True, default=True,
     51                    help='Use 256 color output for decoded highlights. (default)')
    5052options = parser.parse_args()
    5153
     
    6668        return s
    6769
    68     if options.c256:
    69         fg = code%216+16
    70         bg = (code^0xffffffff)%216+16
    71         return "\x1b[0;38;05;%d;48;05;%dm%s\x1b[0m" % (fg,bg,s)
     70    if options.C:
     71        return "\x1b[7m%s\x1b[0m" % s       
    7272    elif options.c:
    7373        fg = code%6+31
     
    7575        return "\x1b[0;%d;%dm%s\x1b[0m" % (fg,bg,s)
    7676    else:
    77         return "\x1b[7m%s\x1b[0m" % s
     77        fg = code%216+16
     78        bg = (code^0xffffffff)%216+16
     79        return "\x1b[0;38;05;%d;48;05;%dm%s\x1b[0m" % (fg,bg,s)
    7880
    7981
Note: See TracChangeset for help on using the changeset viewer.