Skip to content

Commit 18232b7

Browse files
committed
added stub build command
1 parent a4fba24 commit 18232b7

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

cli/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import typer
99
from typer.main import TyperGroup
1010

11-
from commands import hello, list, search, show, version
11+
from commands import build, hello, list, search, show, version
1212
from states.global_state import verbose_flag
1313

1414

@@ -35,6 +35,7 @@ def resolve_command(self, ctx: click.Context, args: List[str]):
3535
app.add_typer(version.app, name="version")
3636
app.command()(show.show)
3737
app.add_typer(search.app, name="search")
38+
app.command()(build.build)
3839

3940

4041
# Main callback to handle global options

cli/commands/build.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Stub command to build the ebook using Ibis.
3+
"""
4+
5+
import typer
6+
7+
from states.global_state import debug, verbose_flag
8+
9+
app = typer.Typer(help="Ebook Builder CLI using Ibis")
10+
11+
12+
@app.command()
13+
def build():
14+
"""Build the ebook using Ibis."""
15+
16+
if verbose_flag["enabled"]:
17+
debug("Starting the build process using Ibis")
18+
19+
typer.echo("Building ebook with Ibis... (this is a stub command)")
20+
21+
if verbose_flag["enabled"]:
22+
debug("Build process completed")

cli/tests/test_cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ def clean_output(text: str) -> str:
5858
(("show", "foobar"), ("Unknown",), 1),
5959
(("search", "grep"), ("grep:",), 0),
6060
(("search", "this-should-not-exist-xyz"), ("No commands found.",), 1),
61+
(("build",), ("Building ebook with Ibis...",), 0),
62+
(
63+
("--verbose", "build"),
64+
(
65+
"[DEBUG] Starting the build process using Ibis",
66+
"Building ebook with Ibis",
67+
"[DEBUG] Build process completed",
68+
),
69+
0,
70+
),
6171
),
6272
)
6373
def test_check_cli(args: tuple[str], expected_strings: tuple[str], exit_code: int):

0 commit comments

Comments
 (0)