-
-
Notifications
You must be signed in to change notification settings - Fork 39
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 a converter specified shortcut #625
Conversation
Add a shortcut specified by RAW and Align Concverter.
Is concverter a real thing or a typo ? |
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.
Cobra is powerful framework, I'm surprised you have to do this
oviewer/oviewer.go
Outdated
if RawF { | ||
root.General.Converter = convRaw | ||
} | ||
if AlignF { | ||
root.General.Converter = convAlign | ||
} |
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.
The logic is strange to read.
So AlignF "wins" vs RawF when present, right?
Maybe this?
if RawF { | |
root.General.Converter = convRaw | |
} | |
if AlignF { | |
root.General.Converter = convAlign | |
} | |
if AlignF { | |
root.General.Converter = convAlign | |
} else if RawF { | |
root.General.Converter = convRaw | |
} |
oviewer/oviewer.go
Outdated
// RawF is specifies converter shortcut for raw. | ||
var RawF bool | ||
|
||
// AlignF is specifies converter shortcut for align. | ||
var AlignF bool |
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.
// RawF is specifies converter shortcut for raw. | |
var RawF bool | |
// AlignF is specifies converter shortcut for align. | |
var AlignF bool | |
// RawF specifies converter shortcut for raw. | |
var RawF bool | |
// AlignF specifies converter shortcut for align. | |
var AlignF bool |
oviewer/oviewer.go
Outdated
// RawF is specifies converter shortcut for raw. | ||
var RawF bool | ||
|
||
// AlignF is specifies converter shortcut for align. | ||
var AlignF bool |
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.
I don't think you need tgem to be exported
oviewer/oviewer.go
Outdated
if RawF { | ||
root.General.Converter = convRaw | ||
} | ||
if AlignF { | ||
root.General.Converter = convAlign | ||
} |
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.
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.
Thank you for your comment.
I moved to the main side and fixed it.
Typo. I will fix it. |
Transferred shortcut handling for align and raw from oviewer/oviewer.go to main.go.
Add a shortcut specified by RAW and Align converter.