Commit b5d9c1e6 authored by Natanael Copa's avatar Natanael Copa
Browse files

ap: cleanup. do not pass the cmd it self as option

parent aa65657a
......@@ -12,7 +12,7 @@ subcmd.revdep = {
usage = "PKG...",
run = function(opts)
local i
for i = 2, #opts do
for i = 1, #opts do
db:foreach_revdep(opts[i], function (k,p)
print(p.pkgname)
end)
......@@ -34,7 +34,7 @@ subcmd.recursdeps = {
desc = "Recursively print all make dependencies for given packages",
usage = "PKG...",
run = function (opts)
for i = 2, #opts do
for i = 1, #opts do
db:recurs_until(opts[i], function(pn)
print(pn)
end)
......@@ -49,12 +49,12 @@ subcmd.builddirs = {
local i, p, _
local visited = {}
local to_print = {}
for i = 2, #opts do
for i = 1, #opts do
db:foreach_pkg(opts[i], function(_, p)
to_print[p.dir] = true
end)
end
for i = 2, #opts do
for i = 1, #opts do
db:recurs_until(opts[i], function(pn)
local j,p
db:foreach_pkg(pn, function(j, p)
......@@ -73,7 +73,7 @@ subcmd.sources = {
usage = "PKG...",
run = function(opts)
local i, p, _
for i = 2, #opts do
for i = 1, #opts do
db:foreach_pkg(opts[i], function(_, p)
aports.foreach_remote_source(p, function(url)
print(p.pkgname, p.pkgver, string.gsub(url, p.pkgver, "$VERSION"))
......@@ -112,7 +112,7 @@ while i <= #arg do
end
cmd = opts[1]
cmd = table.remove(opts, 1)
if cmd == nil then
print_usage()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment