mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-25 00:00:52 -04:00
Make the user listing command handles empty DB
This commit is contained in:
+1
-1
@@ -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 "
|
||||||
|
|||||||
Reference in New Issue
Block a user