From 31566d68cb3365ead1cdc8648c81d62ce966cb6f Mon Sep 17 00:00:00 2001 From: dvs1 Date: Fri, 25 Oct 2024 09:38:35 +1000 Subject: Just discovered the arg variable, use it and rename parseArgs() to just parse(). --- aataaj.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'aataaj.lua') diff --git a/aataaj.lua b/aataaj.lua index 06077c2..6108dd5 100755 --- a/aataaj.lua +++ b/aataaj.lua @@ -143,8 +143,7 @@ local options = ['--help'] = {help}, } -local args = {...} -_.parseArgs(options, args) +_.parse(arg, options) @@ -184,7 +183,7 @@ for i,l in ipairs(cards.lines) do Cards[l]['devs'][n] = n print("\tFound playback device " .. Cards[l].card - 1 .. " : " .. Cards[l]['name'] .. "\tDEVICE: " .. Cards[l]['playbackDevs'][j] .. ' ' .. n) io.flush() - if 'JACK' ~= args[1] then + if 'JACK' ~= arg[1] then print('\t\tALSA_CARD=' .. Cards[l].card - 1 .. ' ' .. speaker .. ' "Found playback device ' .. Cards[l].card - 1 .. ' : ' .. Cards[l]['name'] .. ' DEVICE: ' .. Cards[l]['playbackDevs'][j] .. ' ' .. n .. '"') io.flush() end @@ -221,7 +220,7 @@ print('') io.flush() -if 'start' == args[1] then +if 'start' == arg[1] then __('mkdir -p ' .. asoundrcPath):Do() local a, e = io.open(asoundrcPath .. '/jack-plumbing', "w") if nil == a then print("Could not open " .. asoundrcPath .. '/jack-plumbing') else @@ -391,7 +390,7 @@ pcm.!default { ]]) a:close() end -elseif 'JACK' == args[1] then +elseif 'JACK' == arg[1] then print('') print("Start up JACK and friends.") print("jack_control") -- cgit v1.1