question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How do I mark a command as deprecated?

See original GitHub issue

I 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:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ryandbergercommented, Jan 5, 2022

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!

1reaction
ryandbergercommented, Jan 5, 2022

Yes, I do see the [deprecated] indicator next to command cmd1 when calling --help generally. But when I call cmd1 --help I don’t see the message after the command description which I think is unexpected.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found