Closed chaozbj closed 4 years ago
@chaozbj Thanks for opening this!
for 2, I think we do need a precheck in PreRunE for value of --selector
and give an suggestion if the input is wrong, but maybe not moving whole splitByEqualSign
to PreRunE
@chaozbj Thanks for opening this! for 2, I think we do need a precheck in PreRunE for value of
--selector
and give an suggestion if the input is wrong, but maybe not moving wholesplitByEqualSign
to PreRunE
Ok, thanks, I will be careful when I am doing these changes.
@zhanggbj I made changes for this issue and created PR in my repo: https://github.com/chaozbj/client-contrib/pull/3, the changes are simple, please help me have a look when you are free. I didn't create a formal PR in this repo since I think there are conflicts between our changes and github may can not automatically merge it. So I want to wait your changes to merge first, and then submit a formal PR for my changes. Any problems, please let me know, thanks a lot!
/assign I would like to work on it
@chaozbj would you please also handle the comments for domain subcommand and some other wording as suggested here? https://github.com/knative/client-contrib/pull/40#discussion_r444649879 https://github.com/knative/client-contrib/pull/40#discussion_r444652039 https://github.com/knative/client-contrib/pull/40#discussion_r444657724 https://github.com/knative/client-contrib/pull/40#discussion_r444660533
@zhanggbj ok, I will handle them.
The codes have been merged and would like to close. /close
@chaozbj: Closing this issue.
When I tried to use
kn-admin domain set
to config a custom domain, I found the below points that we can improve to provide a better user experience:--selector
description, we can add an example like: app=prod to help user understand how to use this flag, and also we can tell user the flag can be used multiple times with different selectors.error
returned fromsplitByEqualSign
function, and tell user the detail error message if the given selector is invalid. Also @zhanggbj suggests moving the selector parsing codes intoPreRunE
phrase. https://github.com/knative/client-contrib/blob/f207c1f9a74266bebeb5a2a32f2a51cf8f9cd87f/plugins/admin/pkg/command/domain/set.go#L62--help
to show the usage details. I triedknative
command and no such behavior, I think we'd better keep the same withkn
command. Here is an example for our domain command:Flags: -d, --custom-domain string desired custom domain -h, --help help for set --selector strings domain selector
Global Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml)