diff options
author | Gar <gar+gh@danger.computer> | 2021-03-04 07:26:33 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-03-09 22:10:06 +0300 |
commit | 9fe0df5b5d7606e5841288d9931be6c04767c9ca (patch) | |
tree | 50b916523fe4a5ebab6010b137cc931cc2a9ce70 /lib/dedupe.js | |
parent | 85a8694dd9b4a924a474ba75261914511a216868 (diff) |
fix(usage): clean up usage declarations
Small refactor of commands to allow usage to be more programmatically
generated, leading us in the direction of more tighly coupling each
command to the params it accepts.
PR-URL: https://github.com/npm/cli/pull/2821
Credit: @wraithgar
Close: #2821
Reviewed-by: @isaacs
Diffstat (limited to 'lib/dedupe.js')
-rw-r--r-- | lib/dedupe.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/dedupe.js b/lib/dedupe.js index 59978895e..50a56211f 100644 --- a/lib/dedupe.js +++ b/lib/dedupe.js @@ -1,16 +1,13 @@ // dedupe duplicated packages, or find them in the tree const Arborist = require('@npmcli/arborist') -const usageUtil = require('./utils/usage.js') const reifyFinish = require('./utils/reify-finish.js') -class Dedupe { - constructor (npm) { - this.npm = npm - } +const BaseCommand = require('./base-command.js') +class Dedupe extends BaseCommand { /* istanbul ignore next - see test/lib/load-all-commands.js */ - get usage () { - return usageUtil('dedupe', 'npm dedupe') + static get name () { + return 'dedupe' } exec (args, cb) { |