def passing_var(audio_input, passing):
    if audio_input in keyword_list and passing == 0:
        programs.tts(response)
        if arg == '-t':
            command(input("> ").lower())
        else:
            reg_input = audio.record(command_seconds, 1)
            if reg_input is not None and reg_input != False:
                passing_var(reg_input, 1)
            elif reg_input == "invalid input":
                audio.tts(reg_input)
    elif audio_input in running_list and passing == 0:
        command(audio_input)
    elif audio_input not in keyword_list and passing == 0:
        listen()
    elif passing == 1:
        command(audio_input)
def command(audio_input):
    global bash_key_list
    global bash_command_list
    
    if audio_input in running_list:
        place = find(running_keys, audio_input)
        command = running_command[place[0]]
        subprocess.call("%s" % command, shell=True)
        listen()
    elif audio_input in tts_list:
        place = find(tts_key_list, audio_input)
        command = tts_command_list[place[0]]
        programs.tts(command)
        listen()
    elif audio_input in bash_list:
        place = find(bash_key_list, audio_input)
        command = bash_command_list[place[0]]
        subprocess.call("%s" % command, shell=True)
        listen()
    elif audio_input == exit_command:
        sys.exit("Thank you, come again.")
        
    tts_start_list = []
    for i in range(0, len(tts_list)):
        if "+" in tts_list[i].split():
            command_start = tts_list[i].split()
            command_start = " ".join(command_start[0:tts_list[i].split().index("+")])
            tts_start_list.append(command_start)   
    
    bash_start_list = []
    for i in range(0, len(bash_list)):
        if "+" in bash_list[i].split():
            command_start = bash_list[i].split()
            command_start = " ".join(command_start[0:bash_list[i].split().index("+")])
            bash_start_list.append(command_start)
                
    other_start_list = []
    for i in range(0, len(other_list)):
        if "+" in other_list[i].split():
            command_start = other_list[i].split()
            command_start = " ".join(command_start[0:other_list[i].split().index("+")])
            other_start_list.append(command_start)  
    
    splited = audio_input.split()
    part = []
    rest = []

    for i in range(1, len(splited) + 1):
        part.append(" ".join(splited[0:i]))
        rest.append(" ".join(splited[i:]))

    for i in range(0, len(part)):
        if part[i] in tts_start_list:
            part[i] = part[i] + " +"
            place = find(tts_key_list, part[i])
            command = tts_command_list[place[0]]
            command = command + " " + rest[i]
            programs.tts(command)
            listen()
        elif part[i] in bash_start_list:
            part[i] = part[i] + " +"
            place = find(bash_key_list, part[i])
            command = bash_command_list[place[0]]
            if command.split()[-1] == "(space)":
                command = command[:-7]
            command = command + rest[i]
            subprocess.call("%s" % command, shell=True)
            listen()
        elif part[i] in other_start_list:
            part[i] = part[i] + " +"
            place = find(other_key_list, part[i])
            command = other_command_list[place[0]]
            command_start_list = []
            if command == "torrent":
                programs.torrent(rest[i])
                listen()
            elif command == "youtube":
                programs.youtube(rest[i])
                listen()
        else:
            listen()