aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/cli.lua
diff options
context:
space:
mode:
Diffstat (limited to 'stand/lua/cli.lua')
-rw-r--r--stand/lua/cli.lua22
1 files changed, 9 insertions, 13 deletions
diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua
index 6832da0a31a5..dda8c3da4c89 100644
--- a/stand/lua/cli.lua
+++ b/stand/lua/cli.lua
@@ -30,18 +30,6 @@ local core = require("core")
local cli = {}
-if not pager then
- -- shim for the pager module that just doesn't do it.
- -- XXX Remove after 12.2 goes EoL.
- pager = {
- open = function() end,
- close = function() end,
- output = function(str)
- printc(str)
- end,
- }
-end
-
-- Internal function
-- Parses arguments to boot and returns two values: kernel_name, argstr
-- Defaults to nil and "" respectively.
@@ -247,9 +235,17 @@ cli["disable-device"] = function(...)
return
end
+ if #argv > 1 then
+ print("Too many arguments")
+ print("usage error: disable-device device")
+ return
+ end
+
d, u = string.match(argv[1], "(%w*%a)(%d+)")
- if d ~= nil then
+ if d ~= nil and u ~= nil then
loader.setenv("hint." .. d .. "." .. u .. ".disabled", "1")
+ else
+ print("Cannot parse " .. argv[1] .." into driver and unit number.")
end
end