From 282b638928b130bb8c2c4d273c27daf7348d643a Mon Sep 17 00:00:00 2001 From: lesion Date: Thu, 5 May 2022 11:12:53 +0200 Subject: [PATCH] minor with cli --- server/cli/accounts.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/cli/accounts.js b/server/cli/accounts.js index 05d181dc..94b0b97f 100644 --- a/server/cli/accounts.js +++ b/server/cli/accounts.js @@ -26,6 +26,7 @@ async function modify (args) { } async function add (args) { + } async function list () { @@ -33,7 +34,7 @@ async function list () { const User = require('../api/models/user') const users = await User.findAll() console.log() - users.forEach(u => console.log(`${u.id}\tadmin: ${u.is_admin}\tenabled: ${u.is_active}\temail: ${u.email} - ${u.password}`)) + users.forEach(u => console.log(`${u.id}\tadmin: ${u.is_admin}\tenabled: ${u.is_active}\temail: ${u.email}`)) console.log() } @@ -42,13 +43,19 @@ const accountsCLI = yargs => { .command('list', 'List all accounts', list) .command('modify', 'Modify', { account: { - describe: 'Account to modify' + describe: 'Account to modify', + type: 'string', + demandOption: true }, 'reset-password': { - describe: 'Resets the password of the given accoun ' + describe: 'Resets the password of the given accoun ', + type: 'boolean' } }, modify) .command('add', 'Add an account', {}, add) + .recommendCommands() + .strict() + .demandCommand(1, '') } module.exports = accountsCLI