diff --git a/execexam/display.py b/execexam/display.py index 0abd723..f283eda 100644 --- a/execexam/display.py +++ b/execexam/display.py @@ -35,50 +35,51 @@ def display_tldr(console: Console) -> None: console.print( "[bold yellow]Too Lazy; Didn't Read: Example Commands[/bold yellow]\n" ) - console.print( - "[bold red]Please ensure you are in the directory with the pyproject.toml file to run these commands.[/bold red]\n" - ) - - console.print( - "[bold cyan]poetry run execexam [/bold cyan]" - ) - console.print( - " Run executable exam for a project with the specified test files." - ) - - console.print( - "[bold cyan]poetry run execexam --mark [/bold cyan]" - ) - console.print(" Run the tests with the specified mark(s).") - - console.print( - "[bold cyan]poetry run execexam --maxfail[/bold cyan]" - ) - console.print(" Limit the number of test failures before stopping.") - - console.print( - "[bold cyan]poetry run execexam --report /[/bold cyan]" - ) - console.print( - " Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types." - ) - - console.print( - "[bold cyan]poetry run execexam --advice-model --advice-method [/bold cyan]" - ) - console.print( - " Use specified LLM model and method for providing advice on test failures." - ) - console.print( - "[bold cyan]poetry run execexam <--debug>/<--no-debug>[/bold cyan]" - ) - console.print(" Display or disable debugging information.") - - console.print( - "[bold cyan]poetry run execexam <--fancy>/<--no-fancy>[/bold cyan]" - ) - console.print(" Display or disable fancy output formatting.") + commands = { + "mark": { + "command": "execexam --mark mark_type", + "description": "Run tests with specific markers.", + }, + "maxfail": { + "command": "execexam --maxfail number", + "description": "Set maximum number of test failures before stopping test execution (default: 10)", + }, + "report": { + "command": "execexam --report report_type/all", + "description": "Generate the specified type(s) of reports after the exam. Use 'all' to generate all available report types.", + }, + "advice-method": { + "command": "execexam --advice-method --advice-model --advice-server ", + "description": "Specify the LLM model and advice method to use Coding Mentor. Consult documentation for available models and methods.", + }, + "debug": { + "command": "execexam --debug/--no-debug", + "description": "Enable or disable debug mode to collect additional debugging information during execution.", + }, + "fancy": { + "command": "execexam --fancy/--no-fancy", + "description": "Toggle fancy output formatting. Disable for simpler output in plain-text environments.", + }, + "verbose": { + "command": "execexam --verbose/--no-verbose", + "description": "Enable or disable verbose output to see more detailed logs of the program's execution.", + }, + "syntax-theme": { + "command": "execexam --syntax-theme theme_name", + "description": "Choose syntax highlighting theme for code output (options: ansi_dark, ansi_light)", + }, + } + + for command_name, command_info in commands.items(): + console.print(f"[bold green]{command_name}[/bold green]") + console.print( + f"[bold white]Command:[/bold white] [bold cyan]{command_info['command']}[/bold cyan]" + ) + console.print( + f"[bold white]Description:[/bold white] {command_info['description']}" + ) + console.print() console.print( "\n[bold yellow]help:[/bold yellow] Use [bold yellow]--help[/bold yellow] to see more options." diff --git a/execexam/main.py b/execexam/main.py index 9629bda..65fb35e 100644 --- a/execexam/main.py +++ b/execexam/main.py @@ -62,7 +62,7 @@ def run( # noqa: PLR0913, PLR0915 callback=tldr_callback, help="Display summary of commands", ), - ] = None, + ] = False, report: Optional[List[enumerations.ReportType]] = typer.Option( None, help="Types of reports to generate", @@ -103,8 +103,9 @@ def run( # noqa: PLR0913, PLR0915 litellm_thread = threading.Thread(target=advise.load_litellm) # if --tldr was specified, then display the TLDR summary # of the commands and then exit the program - if tldr is not None: - return + if tldr: + display.display_tldr(console) + raise typer.Exit() # if execexam was configured to produce the report for advice # or if it was configured to produce all of the possible reports, # then start the litellm thread that provides the advice diff --git a/pyproject.toml b/pyproject.toml index 1bcd22a..11bb85d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.poetry] name = "execexam" -version = "0.3.1" +version = "0.3.2" description = "ExecExam runs executable examinations, providing feedback and assistance!" -authors = ["Gregory M. Kapfhammer "] +authors = ["Hemani Alaparthi ","Gregory M. Kapfhammer "] readme = "README.md" [tool.poetry.scripts]