Coverage for tests / assets / hidden_commands.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-11-18 11:12 +0000

1import typer 1abcdefghij

2 

3app = typer.Typer() 1abcdefghij

4 

5 

6@app.command() 1abcdefghij

7def visible(): 1abcdefghij

8 """Visible command.""" 

9 

10 

11@app.command(hidden=True) 1abcdefghij

12def hidden_decorated(): 1abcdefghij

13 """Hidden via @app.command(hidden=True).""" 

14 

15 

16def hidden_var(): 1abcdefghij

17 """Hidden via app.command(name, hidden=True)(fn).""" 

18 

19 

20app.command("hidden-var", hidden=True)(hidden_var) 1abcdefghij

21 

22hidden_subgroup = typer.Typer(hidden=True) 1abcdefghij

23 

24 

25@hidden_subgroup.command() 1abcdefghij

26def sub(): 1abcdefghij

27 """Hidden subgroup command.""" 

28 

29 

30app.add_typer(hidden_subgroup, name="hidden-subgroup") 1abcdefghij