Coverage for zombie_nomnom/app.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.6.8, created at 2024-12-05 01:14 +0000

1""" 

2Module that contains the click entrypoint for our cli interface. 

3 

4Currently this only contains code to run the game form the cli but this will be extended  

5to also run this as a web app including a built in server with react spa app. 

6""" 

7 

8import click 

9from .cli import run_game 

10 

11 

12@click.group() 

13def main(): 

14 """ 

15 main group that represents the top-level: ***zombie-nomnom*** 

16 

17 This will be used to decorate sub-commands for zombie-nomnom. 

18 

19 ***Example Usage:*** 

20 ```python 

21 @main.command("sub-command") 

22 def sub_command(): 

23 # do actual meaningful work. 

24 pass 

25 ``` 

26 """ 

27 pass 

28 

29 

30@main.command("cli") 

31def cli(): 

32 """ 

33 Command to start the zombie_dice game from the command line. 

34 """ 

35 run_game() 

36 

37 # ask after we finish a single game assume they will quit when they want to. 

38 while click.confirm(text="Play another game of zombie dice?"): 

39 run_game() 

40 

41 click.echo("Thank you for playing!!")