Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
with ArgumentsContext(self, 'serve') as ac:
ac.argument('env_grpc_port', default=False, required=False)
ac.argument('grpc_port', default=3001, type=int, required=False)
with ArgumentsContext(self, 'analyze') as ac:
ac.argument('env_grpc_port', default=False, required=False)
ac.argument('grpc_port', default=3001, type=int, required=False)
ac.argument('text', required=True)
ac.argument('fields', nargs='*', required=True)
super(CommandsLoader, self).load_arguments(command)
presidio_cli = CLI(
cli_name=CLI_NAME,
config_dir=os.path.join('~', '.{}'.format(CLI_NAME)),
config_env_var_prefix=CLI_NAME,
commands_loader_cls=CommandsLoader,
help_cls=PresidioCLIHelp)
exit_code = presidio_cli.invoke(sys.argv[1:])
sys.exit(exit_code)
def load_command_table(self, args):
with CommandGroup(self, '', '__main__#{}') as g:
g.command('serve', 'serve_command_handler', confirmation=False)
g.command('analyze', 'analyze_command_handler', confirmation=False)
return super(CommandsLoader, self).load_command_table(args)