aboutsummaryrefslogtreecommitdiff
path: root/lua/pets/commands.lua
diff options
context:
space:
mode:
authorGiuseppe Gadola <giusgadola@gmail.com>2023-02-10 11:38:56 +0100
committerGiuseppe Gadola <giusgadola@gmail.com>2023-02-10 16:05:59 +0100
commit71fbb46029a52e840eac65a23027ae5f1a3ef7d8 (patch)
tree2f9b00301bd146661f2c9bfe69a2bd443f7b66e7 /lua/pets/commands.lua
parentdocs: added some basic comments to explain functions (diff)
feat(pets): ability to remove pets
Diffstat (limited to 'lua/pets/commands.lua')
-rw-r--r--lua/pets/commands.lua12
1 files changed, 4 insertions, 8 deletions
diff --git a/lua/pets/commands.lua b/lua/pets/commands.lua
index 80709fd..8c521cd 100644
--- a/lua/pets/commands.lua
+++ b/lua/pets/commands.lua
@@ -1,13 +1,9 @@
local pets = require("pets")
-vim.api.nvim_create_user_command("Pets", function()
- pets.show()
-end, {}) -- use nargs = 1 to accept arguments
-
vim.api.nvim_create_user_command("PetsNew", function(input)
- pets.create_pet("Giulio", "cat", "brown") -- TODO: use input.args as name
-end, { nargs = 1 }) -- use nargs = 1 to accept arguments
+ pets.create_pet(input.args, "cat", "brown")
+end, { nargs = 1 })
-vim.api.nvim_create_user_command("PetsCloseAll", function()
- pets.closeAll()
+vim.api.nvim_create_user_command("PetsKillAll", function()
+ pets.kill_all()
end, {})