-
Notifications
You must be signed in to change notification settings - Fork 149
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
Output usage only when flag parsing fails #4381
Comments
In this comment on the cobra's issue, it is suggested to disable showing usage by default, and show it only when flag parsing fails. So how would you like to fix like this? |
FYI, this is draft fix ffjlabo@d395ee3. when parsing fails
when internal errors
|
Nice, could you commit the fix 🙏 And welcome back @ffjlabo 🙌 |
It's been a while @khanhtc1202 san! Oh...I forgot to tell one thing. |
@ffjlabo For sure if you think it's the better choice 😄 |
@ffjlabo Hi there, any update on this? If possible, we would like to add this to the next release (v0.44.2) Please lets me know if you want some help 😄 |
@khanhtc1202 Sorry to be late. I forgot to make a PR 🙇 |
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]>
Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]>
) * Update web deps (#4451) Signed-off-by: khanhtc1202 <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Update quickstart to support arm hardware(ex: M1) (#4457) * Add: arch selection for mysql image Update chart values and templates for mysql deployment Signed-off-by: gitbluf <[email protected]> * Update: MySql image selector function to be more descriptive Signed-off-by: gitbluf <[email protected]> * Remove: mysql image set on piped installation Signed-off-by: gitbluf <[email protected]> * Update method name Signed-off-by: gitbluf <[email protected]> --------- Signed-off-by: gitbluf <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Support AWS LoadBalancer with multi listeners (#4462) * Support AWS LoadBalancer with multi listeners Signed-off-by: khanhtc1202 <[email protected]> * Fix go array index Signed-off-by: khanhtc1202 <[email protected]> * Rename symbol Signed-off-by: khanhtc1202 <[email protected]> --------- Signed-off-by: khanhtc1202 <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Specify Version For Templating Tools (#4463) * specify version for templating tools Signed-off-by: Viet Anh Pham Nhu <[email protected]> * Handle Error Both Install Helm And Kustomize Signed-off-by: Viet Anh Pham Nhu <[email protected]> --------- Signed-off-by: Viet Anh Pham Nhu <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Output usage only when flag parsing fails #4381 (#4464) Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Fix ECS rollback stage does not remove canary created tasks (#4465) * Fix cannot remove canary created task Signed-off-by: ductnn <[email protected]> * Fix reuse clean function Signed-off-by: ductnn <[email protected]> * Update logs message for ECS routing stage rollback Signed-off-by: ductnn <[email protected]> --------- Signed-off-by: ductnn <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Update logs message for ECS routing stage executor (#4466) Signed-off-by: khanhtc1202 <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * fix: update deprecated apiVersion since gke removed (#4469) GoogleCloudPlatform/gke-managed-certs#58 Signed-off-by: hungran <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> * Skip update AppState when no log updates (#4482) Signed-off-by: Kenta Kozuka <[email protected]> --------- Signed-off-by: khanhtc1202 <[email protected]> Signed-off-by: Kenta Kozuka <[email protected]> Signed-off-by: gitbluf <[email protected]> Signed-off-by: Viet Anh Pham Nhu <[email protected]> Signed-off-by: Yoshiki Fujikane <[email protected]> Signed-off-by: ductnn <[email protected]> Signed-off-by: hungran <[email protected]> Co-authored-by: Khanh Tran <[email protected]> Co-authored-by: Marko Petrovic <[email protected]> Co-authored-by: Viet Anh Pham Nhu <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Duc Tran <[email protected]> Co-authored-by: Henry Vu <[email protected]> Co-authored-by: Kurochan <[email protected]>
What would you like to be added:
I propose that clis output usage only when flag parsing fails, not when internal errors occur.
Why is this needed:
When I tried to do quickstart with pipectl, an error occurs.
I tried to do quickstart with pipectl and encounter the error log below
At first glance, it seems that only the stack trace is displayed, but in fact the specific error message is displayed at the bottom.
In my opinion, it is difficult to find the message quickly.
This is because usage is shown before cli handles error on app.Run().
By default, cobra shows usage when command.Execute(). ref: the internal of it
The text was updated successfully, but these errors were encountered: