[Question] How do I mark a command as deprecated?
See original GitHub issueI see from https://github.com/yargs/yargs/pull/1559 that it is now possible to mark options as deprecated. I have attempted to use this functionality at a higher level to mark an entire command as deprecated, but it does not work. Is this feature not yet implemented or am I missing something?
This is the usage I am attempting:
module.exports = {
command: 'old [path]',
deprecated: '[deprecated: use new instead]'
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do you mark code as deprecated in Go? - Stack Overflow
The only way is to put the deprecation warning in documentation, or simply delete the code. Share.
Read more >A proxy command for deprecation - LaTeX Stack Exchange
(notice that the deprecated command should be used "by name" in the first argument). In the document, the first usage of \foo will...
Read more >How and When to Deprecate APIs - Oracle Help Center
Starting with J2SE 5.0, you deprecate a class, method, or field by using the @Deprecated annotation. Additionally, you can use the @deprecated Javadoc...
Read more >Special Commands - Doxygen Manual
All commands in the documentation start with a backslash (\) or an at-sign (@). If you prefer you can replace all commands starting...
Read more >Deprecating and undeprecating packages or package versions
On the npm "Sign In" page, enter your account details and click Sign In. ... Click Settings. ... Under "deprecate package", click Deprecate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Would love to see a warning emitted when the command is used. I think that would be particularly useful for automation processes. For your approach, I personally would lean towards option 2 since I imagine developers would want consistent behavior across their app. I think it would also make option 3 more natural to implement when the time comes. Appreciate your help on this!
Yes, I do see the
[deprecated]
indicator next to commandcmd1
when calling--help
generally. But when I callcmd1 --help
I don’t see the message after the command description which I think is unexpected.