File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- const mri = require ( 'mri' )
43const npmDistTag = require ( '../' )
4+ const { parseArgs } = require ( 'node:util' )
55
66const help = `
77Usage: npm-dist-tag [options]
@@ -14,21 +14,25 @@ Options:
1414
1515const run = async ( ) => {
1616 try {
17- const args = process . argv . slice ( 2 )
18-
19- const options = mri ( args , {
20- alias : {
21- p : 'package' ,
22- v : 'version' ,
23- h : 'help'
17+ const { values } = parseArgs ( {
18+ options : {
19+ package : {
20+ type : 'string' ,
21+ short : 'p' ,
22+ } ,
23+ version : {
24+ type : 'string' ,
25+ short : 'v' ,
26+ } ,
27+ help : {
28+ type : 'boolean'
29+ } ,
2430 } ,
25- unknown : ( option ) => {
26- const message = `Unknown option "${ option } "`
27- throw Error ( [ message , help ] . join ( '\n' ) )
28- }
2931 } )
3032
31- const result = options . help ? help : await npmDistTag ( options )
33+ console . log ( values )
34+
35+ const result = values . help ? help : await npmDistTag ( values )
3236
3337 console . log ( result )
3438 process . exit ( 0 )
You can’t perform that action at this time.
0 commit comments