mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
chore: 更新版本号至0.3.2并重构pkg命令补全逻辑
将installer.lua和bios.lua中的版本号从0.3.1更新至0.3.2 使用completion.build重构pkg命令补全逻辑,简化代码结构
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
_G._HOST = _G._HOST .. " (LeonOS 0.3.1)"
|
_G._HOST = _G._HOST .. " (LeonOS 0.3.2)"
|
||||||
local fs = rawget(_G, "fs")
|
local fs = rawget(_G, "fs")
|
||||||
|
|
||||||
_G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom"
|
_G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom"
|
||||||
@@ -32,7 +32,7 @@ local rc = {
|
|||||||
_VERSION = {
|
_VERSION = {
|
||||||
major = 0,
|
major = 0,
|
||||||
minor = 3,
|
minor = 3,
|
||||||
patch = 1
|
patch = 2
|
||||||
},
|
},
|
||||||
queueEvent = pull(os, "queueEvent"),
|
queueEvent = pull(os, "queueEvent"),
|
||||||
startTimer = pull(os, "startTimer"),
|
startTimer = pull(os, "startTimer"),
|
||||||
|
|||||||
@@ -1,31 +1,6 @@
|
|||||||
-- pkg command completion
|
|
||||||
local shell = require("shell")
|
local shell = require("shell")
|
||||||
local completion = require("cc.shell.completion")
|
local completion = require("cc.shell.completion")
|
||||||
|
|
||||||
-- 定义pkg命令的补全函数
|
shell.setCompletionFunction("pkg", completion.build(
|
||||||
local function pkg_completion(shell, index, text, previous)
|
completion.choice{"install", "update", "remove", "list", "search", "info", "help"},
|
||||||
-- 子命令补全
|
))
|
||||||
if index == 1 then
|
|
||||||
return completion.choice(text, {"install", "update", "remove", "list", "search", "info", "help"})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 选项补全 (--force, --local)
|
|
||||||
if text:sub(1, 2) == "--" then
|
|
||||||
return completion.choice(text, {"--force", "--local"})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 命令特定补全
|
|
||||||
local command = previous[1]
|
|
||||||
if command == "install" or command == "update" or command == "remove" or command == "info" then
|
|
||||||
-- 这里可以添加包名补全逻辑
|
|
||||||
-- 目前返回空列表
|
|
||||||
return {}
|
|
||||||
elseif command == "search" then
|
|
||||||
-- 搜索查询不需要特定补全
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
|
|
||||||
shell.setCompletionFunction("pkg", pkg_completion)
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- LeonOS installer
|
-- LeonOS installer
|
||||||
local INSTALLER_VERSION = "0.3.1"
|
local INSTALLER_VERSION = "0.3.2"
|
||||||
local DEFAULT_ROM_DIR = "/leonos"
|
local DEFAULT_ROM_DIR = "/leonos"
|
||||||
|
|
||||||
print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")
|
print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")
|
||||||
|
|||||||
Reference in New Issue
Block a user