Skip to content

Commit ad0bbd9

Browse files
abhas20bobbyiliev
authored andcommitted
fixed the issues
1 parent 1c37fd6 commit ad0bbd9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

cli/cli.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
CLI entry point for the 101 Linux Commands application.
33
"""
44

5-
import typer
6-
import click
75
from typing import List
8-
from commands import hello, list, search, show, version
6+
7+
import click
8+
import typer
99
from typer.main import TyperGroup
1010

11+
from commands import hello, list, search, show, version
12+
13+
1114
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]):
1316
try:
1417
return super().resolve_command(ctx, args)
1518
except click.exceptions.UsageError as e:
@@ -21,11 +24,11 @@ def resolve_command(self, ctx: click.Context, args:List[str]):
2124

2225
new_message = f"{original}\n{hint}"
2326
raise click.exceptions.UsageError(new_message, ctx=ctx) from e
24-
27+
2528
raise
26-
2729

28-
app = typer.Typer(help="101 Linux Commands CLI 🚀",cls=CustomTyper)
30+
31+
app = typer.Typer(help="101 Linux Commands CLI 🚀", cls=CustomTyper)
2932
app.add_typer(hello.app, name="hello")
3033
app.add_typer(list.app, name="list")
3134
app.add_typer(version.app, name="version")

cli/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def test_unknown_command():
7878
assert "No such command" in combined_output
7979
assert "Hint: Run 'cli.py --help' to see available commands." in combined_output
8080

81+
8182
# ----------------------------
8283
# Tests for `show` subcommand
8384
# ----------------------------

0 commit comments

Comments
 (0)