18
18
19
19
__version__ = "dice v{0} by {1}." .format (dice .__version__ , dice .__author__ )
20
20
21
- parser = argparse .ArgumentParser (prog = "dice" , description = "Parse and evaluate dice notation." , epilog = __version__ )
22
- parser .add_argument ('-m' , '--min' , action = "store_true" , help = "Make all rolls the lowest possible result." )
23
- parser .add_argument ('-M' , '--max' , action = "store_true" , help = "Make all rolls the highest possible result." )
24
- parser .add_argument ('-D' , '--max-dice' , action = "store" , type = int , metavar = 'N' , help = "Set the maximum number of dice per element." )
25
- parser .add_argument ('-v' , '--verbose' , action = "store_true" , help = "Show additional output." )
26
- parser .add_argument ('-V' , '--version' , action = "version" , version = __version__ , help = "Show the package version." )
27
- parser .add_argument ('expression' , nargs = '+' )
21
+ parser = argparse .ArgumentParser (
22
+ prog = "dice" , description = "Parse and evaluate dice notation." , epilog = __version__
23
+ )
24
+ parser .add_argument (
25
+ "-m" ,
26
+ "--min" ,
27
+ action = "store_true" ,
28
+ help = "Make all rolls the lowest possible result." ,
29
+ )
30
+ parser .add_argument (
31
+ "-M" ,
32
+ "--max" ,
33
+ action = "store_true" ,
34
+ help = "Make all rolls the highest possible result." ,
35
+ )
36
+ parser .add_argument (
37
+ "-D" ,
38
+ "--max-dice" ,
39
+ action = "store" ,
40
+ type = int ,
41
+ metavar = "N" ,
42
+ help = "Set the maximum number of dice per element." ,
43
+ )
44
+ parser .add_argument (
45
+ "-v" , "--verbose" , action = "store_true" , help = "Show additional output."
46
+ )
47
+ parser .add_argument (
48
+ "-V" ,
49
+ "--version" ,
50
+ action = "version" ,
51
+ version = __version__ ,
52
+ help = "Show the package version." ,
53
+ )
54
+ parser .add_argument (
55
+ "expression" ,
56
+ nargs = "+" ,
57
+ help = "One or more expressions in dice notation" ,
58
+ )
28
59
29
60
30
61
def main (args = None ):
@@ -40,7 +71,7 @@ def main(args=None):
40
71
f_roll = dice .roll
41
72
42
73
if args .max_dice :
43
- f_kwargs [' max_dice' ] = args .max_dice
74
+ f_kwargs [" max_dice" ] = args .max_dice
44
75
45
76
f_expr = " " .join (args .expression )
46
77
0 commit comments