🐛 Fix 'list-hosts' when empty #13
4 changed files with 7 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ export default ({
|
||||||
user
|
user
|
||||||
}) => {
|
}) => {
|
||||||
screenStream.stdin.write(
|
screenStream.stdin.write(
|
||||||
|
user.getHosts().length === 0 ? getString('home.listHosts.noHosts') :
|
||||||
new AsciiTable()
|
new AsciiTable()
|
||||||
.setHeading('Host', 'URI')
|
.setHeading('Host', 'URI')
|
||||||
.addRowMatrix(user.getHosts().map(host => [
|
.addRowMatrix(user.getHosts().map(host => [
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default ({
|
||||||
.alias('host')
|
.alias('host')
|
||||||
.description(getString('hostsCommand'))
|
.description(getString('hostsCommand'))
|
||||||
.argument('[name]', getString('setHost.name'))
|
.argument('[name]', getString('setHost.name'))
|
||||||
.option('-l, --list', getString('listHosts'))
|
.option('-l, --list', getString('listHosts.title'))
|
||||||
.option('-a, --add', getString('addHost'))
|
.option('-a, --add', getString('addHost'))
|
||||||
.option('-e, --edit [name]', getString('editHost'))
|
.option('-e, --edit [name]', getString('editHost'))
|
||||||
.option('-r, --remove [name]', getString('removeHost.title'))
|
.option('-r, --remove [name]', getString('removeHost.title'))
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ export default ({
|
||||||
}) => program
|
}) => program
|
||||||
.command('list-hosts')
|
.command('list-hosts')
|
||||||
.alias('l')
|
.alias('l')
|
||||||
.description(getString('listHosts'))
|
.description(getString('listHosts.title'))
|
||||||
.action(() => listHosts({
|
.action(() => listHosts({
|
||||||
screenStream,
|
screenStream,
|
||||||
user
|
user
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ i18next.init({
|
||||||
'invalidTotpCode': 'Wrong TOTP code',
|
'invalidTotpCode': 'Wrong TOTP code',
|
||||||
'addHost': 'Add host',
|
'addHost': 'Add host',
|
||||||
'totpCode': 'TOTP code',
|
'totpCode': 'TOTP code',
|
||||||
'listHosts': 'List hosts',
|
|
||||||
'editHost': 'Edit host',
|
'editHost': 'Edit host',
|
||||||
'COMMAND_FAILED': 'Command failed : {{- message}}',
|
'COMMAND_FAILED': 'Command failed : {{- message}}',
|
||||||
'COMMAND_ABORTED': 'Command aborted.',
|
'COMMAND_ABORTED': 'Command aborted.',
|
||||||
|
|
@ -85,6 +84,10 @@ i18next.init({
|
||||||
'enableTotp': 'Enable TOTP (next step)',
|
'enableTotp': 'Enable TOTP (next step)',
|
||||||
'passwordMismatch': 'This password does not match the one you entered via SSH.'
|
'passwordMismatch': 'This password does not match the one you entered via SSH.'
|
||||||
},
|
},
|
||||||
|
'listHosts': {
|
||||||
|
title: 'List hosts',
|
||||||
|
noHosts: 'No hosts configured yet.'
|
||||||
|
},
|
||||||
'setHost': {
|
'setHost': {
|
||||||
'name': 'Name',
|
'name': 'Name',
|
||||||
'nameNew': 'New name',
|
'nameNew': 'New name',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue