Skip to content

Commit

Permalink
fixed subcommands help
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas committed Feb 17, 2025
1 parent e364545 commit 7f6c358
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
const { header, footer, command, flag, arg, summary, description, bail, sloppy } = require('paparam')
const { header, footer, command, flag, arg, summary, description, bail, sloppy, rest } = require('paparam')
const { usage, print } = require('./iface')
const { CHECKOUT } = require('../constants')
const errors = require('../errors')
Expand Down Expand Up @@ -199,8 +199,8 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
() => { console.log(data.help()) }
)

const help = command('help', arg('[command]'), summary('View help for command'), (h) => {
if (h.args.command) console.log(cmd.help(h.args.command))
const help = command('help', rest('[command]'), summary('View help for command'), (h) => {
if (h.rest) console.log(cmd.help(...h.rest))
else console.log(cmd.overview({ full: true }))
})

Expand Down

0 comments on commit 7f6c358

Please sign in to comment.