-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Using --graceful instead of -graceful since single hyphen is treaded as short version of a flag #5604
Comments
right now, I have to do a workaround like this: for i, arg := range os.Args {
if arg == "-graceful" {
nos.Args[i] = "--graceful"
}
} |
good suggestion, can you help to raise a merge request? |
Closed
Hi flycash, here is the merge request: #5633 |
flycash
pushed a commit
that referenced
this issue
Apr 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Go and beego are you using (
bee version
)?the latest
What operating system and processor architecture are you using (
go env
)?irrelevent to the problem
What did you do?
I have a project that is using both cobra and beego, when beego's graceful restart functionality is enabled, cobra treats "- graceful" as "-g" + "raceful"
What did you expect to see?
beego should restart the program using "--graceful" instead of "-graceful"
What did you see instead?
cobra now treats -graceful as "-g" + "raceful", and will return an error.
Why
The single hyphen is used with "short" argument like this:
./bin/abc -h
While the double hyphen is used with "long" argument like this:
./bin/abc --help
IMHO, we should follow the common wisdom and make a small change:

The text was updated successfully, but these errors were encountered: