-
Notifications
You must be signed in to change notification settings - Fork 881
Conversation
This patch provides an implementation of the command used to generate completion code for the bash shell. This feature is extremely useful for distributions of rkt that does not provide bash completion files and can be easily generated by the user instead.
Run: runWrapper(newCompletion(os.Stdout)), | ||
} | ||
|
||
bashCompletionFunc = `__rkt_parse_image() |
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.
Please use bash_completion_func
as this naming convention is more often used in sh world.
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'm simply trying to follow Go naming convention for multiword identifiers, which dictates to use mixed caps instead of underscores: https://golang.org/doc/effective_go.html#mixed-caps.
Do you want me change the identifier back to what is commonly used?
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.
But this is not a golang code, it's bash code, so sh naming convention should be used, instead of linked golang one.
One of better references: https://google.github.io/styleguide/shell.xml?showone=Function_Names#Function_Names
Yes, IMO you should change the identifier back to what was used before.
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.
... very strong facepalm on my side - i misreaded the diff, ybubnov is right that this should be camel case, so it's a good correction later above in rkt/rkt.go
...
Sorry for unnecessary mistake...
@@ -153,7 +97,7 @@ var cmdRkt = &cobra.Command{ | |||
Long: `A CLI for running app containers on Linux. | |||
|
|||
To get the help on any specific command, run "rkt help command".`, | |||
BashCompletionFunction: bash_completion_func, | |||
BashCompletionFunction: bashCompletionFunc, |
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.
So this change will be unnecessary.
Hi, sorry, for being noisy, is something required from my side for this pull-request? |
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.
lgtm
Thanks! |
This patch provides an implementation of the command used to generate completion code for the bash shell. This feature is extremely useful for distributions of rkt that does not provide bash completion files and can be easily generated by the user instead.
closes #3731