def autocomplete(parser):
if COMPLETION_ENABLED:<EOL><INDENT>argcomplete.autocomplete(parser)<EOL><DEDENT>elif '<STR_LIT>' in os.getenv('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>logger.debug('<STR_LIT>')<EOL><DEDENT>
Adds support for shell completion via argcomplete_ by patching given
`argparse.ArgumentParser` (sub)class.

If completion is not enabled, logs a debug-level message.