2
2
CLI entry point for the 101 Linux Commands application.
3
3
"""
4
4
5
- import typer
6
- import click
7
5
from typing import List
8
- from commands import hello , list , search , show , version
6
+
7
+ import click
8
+ import typer
9
9
from typer .main import TyperGroup
10
10
11
+ from commands import hello , list , search , show , version
12
+
13
+
11
14
class CustomTyper (TyperGroup ):
12
- def resolve_command (self , ctx : click .Context , args :List [str ]):
15
+ def resolve_command (self , ctx : click .Context , args : List [str ]):
13
16
try :
14
17
return super ().resolve_command (ctx , args )
15
18
except click .exceptions .UsageError as e :
@@ -21,11 +24,11 @@ def resolve_command(self, ctx: click.Context, args:List[str]):
21
24
22
25
new_message = f"{ original } \n { hint } "
23
26
raise click .exceptions .UsageError (new_message , ctx = ctx ) from e
24
-
27
+
25
28
raise
26
-
27
29
28
- app = typer .Typer (help = "101 Linux Commands CLI 🚀" ,cls = CustomTyper )
30
+
31
+ app = typer .Typer (help = "101 Linux Commands CLI 🚀" , cls = CustomTyper )
29
32
app .add_typer (hello .app , name = "hello" )
30
33
app .add_typer (list .app , name = "list" )
31
34
app .add_typer (version .app , name = "version" )
0 commit comments