mirror of https://github.com/getmango/Mango.git
Make the user listing command handles empty DB
This commit is contained in:
parent
54123917af
commit
fe799f30c8
|
@ -77,7 +77,7 @@ class CLI < Clim
|
||||||
password.not_nil!, opts.admin
|
password.not_nil!, opts.admin
|
||||||
when "list"
|
when "list"
|
||||||
users = storage.list_users
|
users = storage.list_users
|
||||||
name_length = users.map(&.[0].size).max
|
name_length = users.map(&.[0].size).max? || 0
|
||||||
l_cell_width = ["username".size, name_length].max
|
l_cell_width = ["username".size, name_length].max
|
||||||
r_cell_width = "admin access".size
|
r_cell_width = "admin access".size
|
||||||
header = " #{"username".ljust l_cell_width} | admin access "
|
header = " #{"username".ljust l_cell_width} | admin access "
|
||||||
|
|
Loading…
Reference in New Issue