From b3a5c0e67c4639d76d9393462e160748ac1a2aae Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 21 May 2022 11:38:26 -0400 Subject: [PATCH] feat: add disown command --- nature/commands/disown.lua | 14 ++++++++++++++ nature/commands/init.lua | 1 + 2 files changed, 15 insertions(+) create mode 100644 nature/commands/disown.lua diff --git a/nature/commands/disown.lua b/nature/commands/disown.lua new file mode 100644 index 0000000..3d72719 --- /dev/null +++ b/nature/commands/disown.lua @@ -0,0 +1,14 @@ +local commander = require 'commander' + +commander.register('disown', function(args) + local id = tonumber(args[1]) + if not id then + print 'invalid id for job' + return 1 + end + + local ok = pcall(hilbish.jobs.disown, id) + if not ok then + print 'job does not exist' + end +end) diff --git a/nature/commands/init.lua b/nature/commands/init.lua index e824c7c..589cbd5 100644 --- a/nature/commands/init.lua +++ b/nature/commands/init.lua @@ -4,3 +4,4 @@ require 'nature.commands.cdr' require 'nature.commands.doc' require 'nature.commands.exit' require 'nature.commands.guide' +require 'nature.commands.disown'