From 66c6ac367f964aeb49df5be3957de70f306c14e9 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Mon, 4 Nov 2024 13:48:31 +1000 Subject: The command might not be the first argument. --- aataaj.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'aataaj.lua') diff --git a/aataaj.lua b/aataaj.lua index 403593d..fe0d2a4 100755 --- a/aataaj.lua +++ b/aataaj.lua @@ -81,15 +81,15 @@ NOTE - Seems both ALSA and JACK are per user. So you need to run ]] Version = '0.0 crap' - +local cmd = '' local options = { - start = {help = 'Command to start the scanning process, for Sys V init.', }, + start = {help = 'Command to start the scanning process, for Sys V init.', func = function(self, options, a, args, i) cmd = 'start' end}, restart = {start}, ['force-reload'] = {start}, status = {help = 'Command to check the status of the scanning process, for Sys V init.', }, stop = {help = 'Command to stop the scanning process, for Sys V init.', }, - JACK = {help = 'Command to start the JACK stuff, for users.', }, + JACK = {help = 'Command to start the JACK stuff, for users.', func = function(self, options, a, args, i) cmd = 'JACK' end}, STOP = { help = 'Command to stop the JACK stuff, for users.', @@ -223,7 +223,7 @@ for i,l in ipairs(cards.lines) do Cards[n]['devs'][m] = m print('\tFound playback device ' .. Cards[n].card - 1 .. ' : ' .. Cards[n]['name'] .. '\tDEVICE: ' .. Cards[n]['playbackDevs'][j] .. ', sub device ' .. m) -- io.flush() - if 'JACK' ~= arg[1] then + if 'JACK' ~= cmd then -- print('\t\tALSA_CARD=' .. Cards[n].card - 1 .. ' ' .. speaker .. ' "Found playback device ' .. Cards[n].card - 1 .. ' : ' .. Cards[n]['name'] .. ' DEVICE: ' .. Cards[n]['playbackDevs'][j] .. ' ' .. m .. '"') -- io.flush() end @@ -252,7 +252,7 @@ local speak = function(card, subdevice, device, words, printIt, forkIt) -- io.flush() end -if 'start' == arg[1] then +if 'start' == cmd then print('Your ' .. cnt .. ' audio devices are - ') for k,C in pairs(Cards) do for j,c in ipairs(C['playbackDevs']) do @@ -466,7 +466,7 @@ pcm.!default { ]]) a:close() end -elseif 'JACK' == arg[1] then +elseif 'JACK' == cmd then print('') print('Start up JACK and friends.') print('jack_control') -- cgit v1.1