diff options
| author | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 11:38:56 +0100 |
|---|---|---|
| committer | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 16:05:59 +0100 |
| commit | 71fbb46029a52e840eac65a23027ae5f1a3ef7d8 (patch) | |
| tree | 2f9b00301bd146661f2c9bfe69a2bd443f7b66e7 /lua/pets/commands.lua | |
| parent | docs: 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.lua | 12 |
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, {}) |