-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: Big refactoring of main.go #20
Conversation
jirihnidek
commented
Nov 1, 2022
- Functions of sub-commands were moved to function outside of main function. Created several functions to not duplicate code. Side effect of this effort is better displaying of errors for "connect" sub-command.
- Functions for "main" and "before" actions were also move outside main function
- Fixed one small issue with registration to RHSM. It is possible to use --organization, when --username and --password are specified. The registration process could be improved more, but it should be part of another commit. Added only fix-me comment for this case.
Note: connecting process could look like this:
|
28eab41
to
a17cc61
Compare
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.
Nicely executed! This is a great improvement, and sets us up for further refactoring as this program matures.
a17cc61
to
91aafc8
Compare
* Functions of sub-commands were moved to function outside of main function. Created several functions to not duplicate code. Side effect of this effort is better displaying of errors for "connect" sub-command. * Functions for "main" and "before" actions were also move outside main function * Some constants were removed (better description) * Added some documentation comments to functions * Fixed one small issue with registration to RHSM. It is possible to use --organization, when --username and --password are specified. The registration process could be improved more, but it should be part of another commit. Added only fix-me comment for this case.
91aafc8
to
7051a91
Compare
The connection looks like this, when wrong password is provided:
|
@subpop Hi, can you please review this PR once again? Thanks in advance. |
BTW: created BZ for one issue fixed as part of this PR: https://bugzilla.redhat.com/show_bug.cgi?id=2142797 |
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.
Looks great! I found what looked like one typo in a comment. Otherwise, I'm ready to merge this.
The doc comment in statusAction incorrectly referenced 'rhsm.service'.
aba5f38
to
ffcdabb
Compare