cobra
cobra copied to clipboard
Is there a way to customise entire deprecate message for a command
If we are using two commands together in a cli, eg: apictl list apis -e dev
(listCmd added to RootCmd and listAPIsCmd added to listCmd). we are deprecating the middle command list
and replace it with get
eg: apictl get apis -e dev
.
First I marked the list
as the Deprecated command. However this doesn't print the deprecate message when we used apictl list apis
. It will print deprecate only if we used apictl list
.
When we added the deprecate message to both listCmd and listApisCmd, then the message for listApisCmd is print as follows.
Command "apis" is deprecated, <message>
. First part of the message default prints the last command in the chain and my requirement is not deprecating the last command, but the previous command.
Is there a way to achieve this or customise the entire deprecate message?
This issue is being marked as stale due to a long period of inactivity
This seems like a reasonable problem to discuss fixing; tagging the issue and removing stale.
It seems like the deprecation could be marked as being persistent, so that farther down the callstack you continue to get the same message.
I'm definitely open to reviewing a PR for that; it seems like a pretty common case someone might get backed into.
I would also be interested in customising the deprecation message (needed here - https://github.com/kumahq/kuma/pull/4380). Is it ok to open a PR on this @johnSchnake?
Hi, I'm interested at taking shot at this. Do you mind if I open a PR? @johnSchnake