def _bashcomplete(cmd, prog_name, complete_var=None):
if complete_var is None:<EOL><INDENT>complete_var = '<STR_LIT>' % (prog_name.replace('<STR_LIT:->', '<STR_LIT:_>')).upper()<EOL><DEDENT>complete_instr = os.environ.get(complete_var)<EOL>if not complete_instr:<EOL><INDENT>return<EOL><DEDENT>from ._bashcomplete import bashcomplete<EOL>if bashcomplete(cmd, prog_name, complete_var, complete_instr):<EOL><INDENT>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Internal handler for the bash completion support.