Skip to content

Commit 20183f1

Browse files
committed
Reformat code
1 parent 82051f9 commit 20183f1

File tree

1 file changed

+39
-8
lines changed

1 file changed

+39
-8
lines changed

dice/command.py

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,44 @@
1818

1919
__version__ = "dice v{0} by {1}.".format(dice.__version__, dice.__author__)
2020

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+
)
2859

2960

3061
def main(args=None):
@@ -40,7 +71,7 @@ def main(args=None):
4071
f_roll = dice.roll
4172

4273
if args.max_dice:
43-
f_kwargs['max_dice'] = args.max_dice
74+
f_kwargs["max_dice"] = args.max_dice
4475

4576
f_expr = " ".join(args.expression)
4677

0 commit comments

Comments
 (0)