Skip to content

Commit

Permalink
replaced deprecated paparam hiddenFlag and hiddenCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas committed Oct 23, 2024
1 parent 5a9a0d7 commit c3c0614
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 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, hiddenCommand, arg, summary, description, bail, sloppy, hiddenFlag } = require('paparam')
const { header, footer, command, flag, arg, summary, description, bail, sloppy } = require('paparam')
const { usage, print } = require('./iface')
const { CHECKOUT } = require('../constants')
const errors = require('../errors')
Expand Down Expand Up @@ -62,7 +62,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
flag('--name <name>', 'Advanced. Override app name'),
flag('--no-ask', 'Suppress permissions dialogs'),
flag('--json', 'Newline delimited JSON output'),
hiddenFlag('--encryption-key <name>', 'Application encryption key'),
flag('--encryption-key <name>', 'Application encryption key').hide(),
runners.seed(ipc)
)

Expand All @@ -79,7 +79,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
flag('--name <name>', 'Advanced. Override app name'),
flag('--json', 'Newline delimited JSON output'),
flag('--no-ask', 'Suppress permissions dialogs'),
hiddenFlag('--encryption-key <name>', 'Application encryption key'),
flag('--encryption-key <name>', 'Application encryption key').hide(),
runners.stage(ipc)
)

Expand Down Expand Up @@ -114,7 +114,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
flag('--key', 'View key only'),
flag('--json', 'Newline delimited JSON output'),
flag('--no-ask', 'Suppress permissions dialogs'),
hiddenFlag('--encryption-key <name>', 'Application encryption key'),
flag('--encryption-key <name>', 'Application encryption key').hide(),
runners.info(ipc)
)

Expand All @@ -127,7 +127,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
flag('--json', 'Newline delimited JSON output'),
flag('--force|-f', 'Force overwrite existing files'),
flag('--no-ask', 'Suppress permissions dialogs'),
hiddenFlag('--encryption-key <name>', 'Application encryption key'),
flag('--encryption-key <name>', 'Application encryption key').hide(),
runners.dump(ipc)
)

Expand Down Expand Up @@ -182,12 +182,12 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
else console.log(cmd.overview({ full: true }))
})

const encryptionKey = hiddenCommand(
const encryptionKey = command(
'encryption-key',
command('add', arg('<name>'), arg('<secret>'), (cmd) => runners.encryptionKey(ipc).add(cmd)),
command('remove', arg('<name>'), (cmd) => runners.encryptionKey(ipc).remove(cmd)),
command('generate', (cmd) => runners.encryptionKey(ipc).generate(cmd))
)
).hide()

const cmd = command('pear',
...def.pear,
Expand Down
10 changes: 5 additions & 5 deletions def/pear.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
const { flag, hiddenFlag } = require('paparam')
const { flag } = require('paparam')

module.exports = [
flag('-v', 'Print version'),
Expand All @@ -9,8 +9,8 @@ module.exports = [
flag('--log-stacks', 'Add a stack trace to each log message'),
flag('--log', 'Label:sidecar Level:2 Fields: h:level,h:label'),
flag('--sidecar', 'Boot Sidecar'),
hiddenFlag('--run'), // appling legacy
hiddenFlag('--sandbox'), // appling legacy
hiddenFlag('--appling'), // appling legacy
hiddenFlag('--dht-bootstrap <nodes>')
flag('--run').hide(), // appling legacy
flag('--sandbox').hide(), // appling legacy
flag('--appling').hide(), // appling legacy
flag('--dht-bootstrap <nodes>').hide()
]
18 changes: 9 additions & 9 deletions def/run.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
const { flag, hiddenFlag, arg, rest } = require('paparam')
const { flag, arg, rest } = require('paparam')

module.exports = [
arg('<link|dir>', 'Pear link, alias or directory to run app from'),
Expand All @@ -19,12 +19,12 @@ module.exports = [
flag('--checkout <n|release|staged>', 'Run a checkout from version length'),
flag('--detached', 'Wakeup existing app or run detached'),
flag('--no-ask', 'Suppress permissions dialog'),
hiddenFlag('--dht-bootstrap <nodes>', 'DHT boostrap'),
hiddenFlag('--encryption-key <name>', 'Application encryption key'),
hiddenFlag('--trusted'),
hiddenFlag('--detach'),
hiddenFlag('--trace <n>'),
hiddenFlag('--swap <path>'),
hiddenFlag('--start-id <id>'),
hiddenFlag('--sandbox') // electron passthrough
flag('--dht-bootstrap <nodes>', 'DHT boostrap').hide(),
flag('--encryption-key <name>', 'Application encryption key').hide(),
flag('--trusted').hide(),
flag('--detach').hide(),
flag('--trace <n>').hide(),
flag('--swap <path>').hide(),
flag('--start-id <id>').hide(),
flag('--sandbox').hide() // electron passthrough
]

0 comments on commit c3c0614

Please sign in to comment.