Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
output_env.update(missing_env)
if not missing_only:
output_env.update(given_env)
if configure:
required_env = dict(given_env)
required_env.update(missing_env)
configured_env = _get_configured_env(required_env)
output_env.update(configured_env)
env_str = "#!/bin/bash\n"
env_str += _env2shellcode(output_env)
if auto_completion:
env_str += argcomplete.shellcode(sys.argv[0])
print(env_str)
return 0
def completion(shell: str) -> None:
print(argcomplete.shellcode(sys.argv[0], shell=shell))
def completion(shell: str) -> None:
print(argcomplete.shellcode(sys.argv[0], shell=shell))
def completion(shell: str) -> int:
from sys import stdout
from argcomplete import shellcode # type: ignore
stdout.write(shellcode(
['nichtparasoup'], shell=shell,
use_defaults=True, complete_arguments=None,
))
return 0
def autocomplete(args: AutoArgs):
import argcomplete
try:
if args.executables:
exs = extract_scripts(args.executables, args.mark)
else:
exs = find_scripts(args.mark)
except FileNotFoundError as e:
sys.stderr.write(f"{e}\n")
return
# noinspection PyTypeChecker
print(argcomplete.shellcode(exs, args.use_defaults, args.shell, args.complete_arguments))
print("added autocompletion to files (if you ran this with eval):", file=sys.stderr)
for file in exs:
print(f"- {file}", file=sys.stderr)
def cmd_setup_completion(args: argparse.Namespace):
print(argcomplete.shellcode('randrctl', True, 'bash', None))
return 0
def output_completion(self):
self._out(argcomplete.shellcode(
['vindaloo'],
False,
'bash',
))