feat(command): add show empty validation

This commit is contained in:
2026-03-03 14:03:25 +03:00
parent 906f6348fc
commit bbd89a100d

View File

@@ -12,8 +12,12 @@ class Show(
override val description = "show collection elements" override val description = "show collection elements"
override fun execute() { override fun execute() {
if (collectionManager.getCollection().isNotEmpty()) {
for (product in collectionManager.getCollection()) { for (product in collectionManager.getCollection()) {
io.println(product.toString()) io.println(product.toString())
} }
} else {
io.println("коллекция пустая")
}
} }
} }