Fix CLI plugins list command: use command parameters.

pull/4107/head
John Livingston 2021-05-07 17:32:58 +02:00 committed by Chocobozzz
parent 4076e2ef6b
commit 1e0741d165
1 changed files with 3 additions and 5 deletions

View File

@ -24,7 +24,7 @@ program
.option('-p, --password <token>', 'Password') .option('-p, --password <token>', 'Password')
.option('-t, --only-themes', 'List themes only') .option('-t, --only-themes', 'List themes only')
.option('-P, --only-plugins', 'List plugins only') .option('-P, --only-plugins', 'List plugins only')
.action(() => pluginsListCLI()) .action((options, command) => pluginsListCLI(command, options))
program program
.command('install') .command('install')
@ -61,12 +61,10 @@ if (!process.argv.slice(2).length) {
program.parse(process.argv) program.parse(process.argv)
const options = program.opts()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
async function pluginsListCLI () { async function pluginsListCLI (command: commander.CommanderStatic, options: commander.OptionValues) {
const { url, username, password } = await getServerCredentials(program) const { url, username, password } = await getServerCredentials(command)
const accessToken = await getAdminTokenOrDie(url, username, password) const accessToken = await getAdminTokenOrDie(url, username, password)
let pluginType: PluginType let pluginType: PluginType