-
Notifications
You must be signed in to change notification settings - Fork 2
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 --context support #1
base: main
Are you sure you want to change the base?
Conversation
@@ -8,7 +8,7 @@ describe() { | |||
help() { | |||
echo -e " | |||
Usage: | |||
forward [-n namespace] host [sport:]dport | |||
forward [--context context] [-n namespace] host [sport:]dport |
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.
Let's keep this code consistent and use short options. I would suggest -c context
here.
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.
Just wanted to be in line with other built-in kubectl
commands here. There's just --context
available.
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 understand, nevertheless using short options is cleaner here imho. We already do it for the namespace
which is also supported natively by the kubectl
. So, Iwould either:
- change the
context
to justc
to stay consistent with the current style, - or remove it completely in order to allow users to pass any
kubectl
built-in options, but without creating an explicits support for them here. In this scenario I would leave a note in readme to let users know they could find these options with thekubectl options
.
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 see. But it's a bit different with --namespace
as kubectl
also supports -n
as alias for it while -c
isn't an alias for --context
but is used to specify a config file.
The latter probably would be the approach here but I don't have time to work on this right now.
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.
Sure, no worries, there is no rush, feel free to come back to it when you have more time.
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'll keep using my fork for now.
case "$opt" in | ||
h) | ||
describe | ||
help | ||
;; | ||
n) namespace="$OPTARG" | ||
;; | ||
-) |
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.
Same as above, let's keep it consistent and simplify by using short option.
@levrik direction is good, I have minor comments though |
No description provided.