-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore(CLI): start working on CLI #4067
chore(CLI): start working on CLI #4067
Conversation
…golo-com-and-set-a-base-project
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.
Add an __init__.py
file in this folder please.
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.
Done
cli/cli.py
Outdated
total = 0 | ||
for value in track(range(100), description="Processing..."): | ||
time.sleep(0.01) | ||
total += 1 | ||
if show: |
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.
Do we need this?
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.
Not really, it's to show the status bar
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.
Update: deleted
pyproject.toml
Outdated
optional = true | ||
|
||
[tool.poetry.group.cli.dependencies] | ||
typer = "^0.12.3" |
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.
typer = "^0.12.3" | |
typer = "0.12.3" |
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.
Done
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4067 +/- ##
==========================================
+ Coverage 86.26% 86.35% +0.09%
==========================================
Files 790 790
Lines 24729 24728 -1
==========================================
+ Hits 21333 21355 +22
+ Misses 3396 3373 -23 ☔ View full report in Codecov by Sentry. |
…golo-com-and-set-a-base-project
cli/cli.py
Outdated
@aws.command( | ||
"list-services", help="List the AWS services that are supported by Prowler." | ||
) | ||
def list_services_aws(): | ||
print_services(list_services("aws")) | ||
|
||
|
||
@azure.command( | ||
"list-services", help="List the Azure services that are supported by Prowler." | ||
) | ||
def list_services_azure(): | ||
print_services(list_services("azure")) | ||
|
||
|
||
@gcp.command( | ||
"list-services", help="List the GCP services that are supported by Prowler." | ||
) | ||
def list_services_gcp(): | ||
print_services(list_services("gcp")) | ||
|
||
|
||
@kubernetes.command( | ||
"list-services", help="List the Kubernetes services that are supported by Prowler." | ||
) | ||
def list_services_kubernetes(): | ||
print_services(list_services("kubernetes")) |
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.
Is there any way to make this a generic command for all the providers in typer?
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.
Done
def create_list_commands(provider_typer: typer.Typer, provider_name: str): | ||
@provider_typer.command( | ||
"list-services", | ||
help=f"List the {provider_name} services that are supported by Prowler.", |
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.
Can you get the provider_name
from typer.Typer
?
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.
Yes, done
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.
🔝
Description
In this PR new CLI it's added, I'll be improving this but at the momment It just list services and shows the banner.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.