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

Fixes #21590 - Added error to wrong --output #315

Merged
merged 2 commits into from Sep 10, 2019

Conversation

yifatmakias
Copy link
Contributor

No description provided.

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@yifatmakias yifatmakias changed the title Fixes 21590 - Added print_output_type function Fixes #21590 - Added print_output_type function Sep 9, 2019
Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

Thanks for contributing, @yifatmakias!

Although this addition doesn't prevent the users to run a command by showing an error, I think the better approach will be preventing with showing the right usage, since we don't support other output adapters.

I've already (accidentally) solve it as a part of #312 (see https://github.com/theforeman/hammer-cli/pull/312/files#diff-ebbb17d97d1fa6482776d9c9cad6c3fdL50-L54). If you agree that that's the better approach from the user perspective, you are free to use it within your PR :)

Also, some nitpicks inline and I think if we're going to stick with your solution, we could get rid of theforeman/hammer-cli-foreman#446 by adding output.print_output_type here.

lib/hammer_cli/output/output.rb Outdated Show resolved Hide resolved
@yifatmakias yifatmakias changed the title Fixes #21590 - Added print_output_type function Fixes #21590 - Added error to wrong --output Sep 10, 2019
Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

Good update, @yifatmakias!

Just a few small nitpicks (see inline).

lib/hammer_cli/main.rb Outdated Show resolved Hide resolved
lib/hammer_cli/main.rb Outdated Show resolved Hide resolved
@ofedoren
Copy link
Member

[test]

@ofedoren
Copy link
Member

[test hammer]

Copy link
Member

@ofedoren ofedoren left a comment

Choose a reason for hiding this comment

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

All good now, thanks, @yifatmakias! Merging.

@ofedoren ofedoren merged commit 3fcf76d into theforeman:master Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants