Coverage for cmds/help.py: 92%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

13 statements  

1""" 

2help.py 

3 

4contains chelp() 

5""" 

6 

7from database import get 

8import error 

9 

10 

11async def chelp(*args): 

12 """ 

13 chelp() 

14 

15 stands for command help 

16 

17 returns string for verb 

18 """ 

19 

20 # fix args 

21 args = args[1:] 

22 

23 # check args 

24 if len(args) > 1: 

25 raise error.UnknownArgumentError 

26 

27 if args: 

28 try: 

29 string = '\n'.join(get("helps", args[0])) 

30 except FileNotFoundError as err: 

31 raise error.HelpNotFoundError from err 

32 

33 else: 

34 string = '\n'.join(get("help")) 

35 

36 return f"```{string}```"