summaryrefslogtreecommitdiffhomepage
path: root/libs/lpk/luasrc/lpk.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-28 15:16:44 +0000
committerSteven Barth <steven@midlink.org>2008-07-28 15:16:44 +0000
commit1f3700085c59ea3b3ed162277948771d41a57ccc (patch)
treefe0b3d340a9d9f5e9e7bb0428770aa2fea685571 /libs/lpk/luasrc/lpk.lua
parentdb4447af91e06cbe875fc656a65756751a1549e5 (diff)
libs/lpk: Initial CLI
Diffstat (limited to 'libs/lpk/luasrc/lpk.lua')
-rw-r--r--libs/lpk/luasrc/lpk.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/libs/lpk/luasrc/lpk.lua b/libs/lpk/luasrc/lpk.lua
index ae6aefd6b..56f62f0ca 100644
--- a/libs/lpk/luasrc/lpk.lua
+++ b/libs/lpk/luasrc/lpk.lua
@@ -1,4 +1,43 @@
module("luci.lpk", package.seeall)
+require("luci.lpk.util")
+require("luci.lpk.core")
+
+__appname__ = "LuCI »lpk« Package Manager"
+__version__ = "0.1"
+__authors__ = "Steven Barth, Jo-Philipp Wich"
+__cpyrght__ = string.format("Copyright (c) 2008 %s", __authors__)
+__welcome__ = string.format("%s v%s\n%s",
+ __appname__, __version__, __cpyrght__)
+
+
+options, arguments = luci.lpk.util.getopt(arg)
+config = luci.util.dtable()
+
+local cfgdump = loadfile("/etc/lpk.conf")
+if cfgdump then
+ setfenv(cfgdump, config)
+ pcall(cfgdump)
+end
+
+if #arguments < 1 then
+ print(__welcome__)
+ print([[
+
+Usage:
+ lpk [options] <command> [arguments]
+ lpk [options] install|remove pkg1 [pkg2] [...] [pkgn]
+
+Commands:
+ install - Install packages
+ remove - Remove packages
+ purge - Remove packages and their configuration files
+
+Options:
+ --force-depends - Ignore unresolvable dependencies
+]])
+else
+ -- Start machine
+end