Permalink
Browse files

Allow user to override the mode

  • Loading branch information...
1 parent ad9116e commit 65c5db60f50de760867cbfcb814ac7b20503ea09 @tehmaze committed Nov 15, 2012
Showing with 10 additions and 2 deletions.
  1. +9 −1 lolcat
  2. +1 −1 setup.py
View
10 lolcat
@@ -148,10 +148,18 @@ def run():
parser.add_option('-f', '--force', action='store_true', default=False,
help='Force colour even when stdout is not a tty')
+ parser.add_option('-3', action='store_const', dest='mode', const=8,
+ help='Force 3 bit colour mode')
+ parser.add_option('-4', action='store_const', dest='mode', const=16,
+ help='Force 4 bit colour mode')
+ parser.add_option('-8', action='store_const', dest='mode', const=256,
+ help='Force 8 bit colour mode')
+
options, args = parser.parse_args()
options.os = random.randint(0, 256) if options.seed == 0 else options.seed
+ options.mode = options.mode or detect_mode()
- lolcat = LolCat(mode=detect_mode())
+ lolcat = LolCat(mode=options.mode)
if not args:
args = ['-']
View
@@ -3,7 +3,7 @@
from distutils.core import setup
setup(name='lolcat',
- version='0.42.23',
+ version='0.42.42',
description='Rainbows and unicorns!',
author='Wijnand Modderman-Lenstra',
author_email='maze@pyth0n.org',

0 comments on commit 65c5db6

Please sign in to comment.