From c3c0614889cb8a0331556a5bb6337df79239ab76 Mon Sep 17 00:00:00 2001 From: rafapaezbas Date: Wed, 23 Oct 2024 17:10:31 +0200 Subject: [PATCH] replaced deprecated paparam hiddenFlag and hiddenCommand --- cmd/index.js | 14 +++++++------- def/pear.js | 10 +++++----- def/run.js | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmd/index.js b/cmd/index.js index 80f7597ed..f99a22513 100644 --- a/cmd/index.js +++ b/cmd/index.js @@ -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') @@ -62,7 +62,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => { flag('--name ', 'Advanced. Override app name'), flag('--no-ask', 'Suppress permissions dialogs'), flag('--json', 'Newline delimited JSON output'), - hiddenFlag('--encryption-key ', 'Application encryption key'), + flag('--encryption-key ', 'Application encryption key').hide(), runners.seed(ipc) ) @@ -79,7 +79,7 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => { flag('--name ', 'Advanced. Override app name'), flag('--json', 'Newline delimited JSON output'), flag('--no-ask', 'Suppress permissions dialogs'), - hiddenFlag('--encryption-key ', 'Application encryption key'), + flag('--encryption-key ', 'Application encryption key').hide(), runners.stage(ipc) ) @@ -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 ', 'Application encryption key'), + flag('--encryption-key ', 'Application encryption key').hide(), runners.info(ipc) ) @@ -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 ', 'Application encryption key'), + flag('--encryption-key ', 'Application encryption key').hide(), runners.dump(ipc) ) @@ -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(''), arg(''), (cmd) => runners.encryptionKey(ipc).add(cmd)), command('remove', arg(''), (cmd) => runners.encryptionKey(ipc).remove(cmd)), command('generate', (cmd) => runners.encryptionKey(ipc).generate(cmd)) - ) + ).hide() const cmd = command('pear', ...def.pear, diff --git a/def/pear.js b/def/pear.js index 02a7b8b91..d684fa2f9 100644 --- a/def/pear.js +++ b/def/pear.js @@ -1,5 +1,5 @@ 'use strict' -const { flag, hiddenFlag } = require('paparam') +const { flag } = require('paparam') module.exports = [ flag('-v', 'Print version'), @@ -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 ') + flag('--run').hide(), // appling legacy + flag('--sandbox').hide(), // appling legacy + flag('--appling').hide(), // appling legacy + flag('--dht-bootstrap ').hide() ] diff --git a/def/run.js b/def/run.js index e0bed7e2b..9f321d938 100644 --- a/def/run.js +++ b/def/run.js @@ -1,5 +1,5 @@ 'use strict' -const { flag, hiddenFlag, arg, rest } = require('paparam') +const { flag, arg, rest } = require('paparam') module.exports = [ arg('', 'Pear link, alias or directory to run app from'), @@ -19,12 +19,12 @@ module.exports = [ flag('--checkout ', 'Run a checkout from version length'), flag('--detached', 'Wakeup existing app or run detached'), flag('--no-ask', 'Suppress permissions dialog'), - hiddenFlag('--dht-bootstrap ', 'DHT boostrap'), - hiddenFlag('--encryption-key ', 'Application encryption key'), - hiddenFlag('--trusted'), - hiddenFlag('--detach'), - hiddenFlag('--trace '), - hiddenFlag('--swap '), - hiddenFlag('--start-id '), - hiddenFlag('--sandbox') // electron passthrough + flag('--dht-bootstrap ', 'DHT boostrap').hide(), + flag('--encryption-key ', 'Application encryption key').hide(), + flag('--trusted').hide(), + flag('--detach').hide(), + flag('--trace ').hide(), + flag('--swap ').hide(), + flag('--start-id ').hide(), + flag('--sandbox').hide() // electron passthrough ]