-
Notifications
You must be signed in to change notification settings - Fork 384
Added the list command. #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
d45b8de
7602b5e
03988e8
cae3844
ccaac15
05a9ba8
215404c
df20212
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,14 @@ | ||||||||||||||||||||||||||||||||||
| import typer | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| from commands import hello | ||||||||||||||||||||||||||||||||||
| from commands import list | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Create the root CLI app | ||||||||||||||||||||||||||||||||||
| app = typer.Typer(help="101 Linux Commands CLI 🚀") | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Register subcommands | ||||||||||||||||||||||||||||||||||
| app.add_typer(hello.app, name="hello") | ||||||||||||||||||||||||||||||||||
| app.add_typer(list.app, name="list") | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| from commands import list | |
| # Create the root CLI app | |
| app = typer.Typer(help="101 Linux Commands CLI 🚀") | |
| # Register subcommands | |
| app.add_typer(hello.app, name="hello") | |
| app.add_typer(list.app, name="list") | |
| from commands import list as list_commands | |
| # Create the root CLI app | |
| app = typer.Typer(help="101 Linux Commands CLI 🚀") | |
| # Register subcommands | |
| app.add_typer(hello.app, name="hello") | |
| app.add_typer(list_commands.app, name="list") |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||
| import typer | ||||||||||||||
|
|
||||||||||||||
| app = typer.Typer(help="List the commands available on Linux.") | ||||||||||||||
|
|
||||||||||||||
| @app.command() | ||||||||||||||
|
||||||||||||||
| @app.command() | |
| @app.callback() |
Copilot
AI
Oct 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent punctuation: first three entries end with a period while the last does not, and this inconsistency conflicts with test expectations (which omit periods). Standardize all entries (either all with periods or all without) and sync the tests accordingly.
| "ls - List directory contents.", | |
| "cd - Change directory.", | |
| "pwd - Print working directory.", | |
| "ls - List directory contents", | |
| "cd - Change directory", | |
| "pwd - Print working directory", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing a module named list masks the built-in list type in this scope, reducing clarity; renaming the module (e.g., commands_list) or importing with an alias (from commands import list as list_commands) would avoid overshadowing and make intent clearer. Update the registration accordingly (app.add_typer(list_commands.app, name="list")).