Skip to content
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

Add show subcommand #85

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Add show subcommand #85

merged 1 commit into from
Apr 14, 2022

Conversation

LegenJCdary
Copy link
Collaborator

fixing issue #82


def verify_subcommand(command: str):
"""Function to check the first arguments for a valid subcommand"""
if command not in SUBCOMMANDS:
print("[CRITICAL]: Unknown subcommand :%s", (command), file=sys.stderr)
sys.exit("55")

def verify_switches(switches: list):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that the job for validate_options?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show command seems unique so far because it's only subcommand that accepts following positional arguments. It doesn't make much difference from user perspective (miliseconds maybe) but I think positional and optional arguments should be validated separately. I propose merging verify_subcommand and verify_switches in this commit or after restructure (#84 ).

@@ -589,6 +609,38 @@ def list_tasks(config: dict, options: dict):

print(" ".join(task_list))

def show_deployer(config: dict, options: dict):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it's a moment to move subcommand specific functions to separete file? I'm not 100% sure but if you know how to do that then go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll do #81 and then #84 .

@LegenJCdary LegenJCdary force-pushed the add_show_subcommand branch 2 times, most recently from 8a1ce54 to 5af864b Compare April 8, 2022 10:56
@LegenJCdary LegenJCdary requested a review from cinek810 April 8, 2022 10:59
@LegenJCdary LegenJCdary force-pushed the add_show_subcommand branch 2 times, most recently from 3ec070f to eec3675 Compare April 14, 2022 06:40
Add function show_deployer and format_show_deployer
Add tests for show subcommand in 01 and 02
@LegenJCdary LegenJCdary force-pushed the add_show_subcommand branch from eec3675 to f92ccc5 Compare April 14, 2022 06:45
@LegenJCdary LegenJCdary merged commit 734ea00 into main Apr 14, 2022
@LegenJCdary LegenJCdary deleted the add_show_subcommand branch April 14, 2022 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants