コード例 #1
0
 def RunWithArgs(self):
     """Start an interactive session."""
     prompt = FLAGS.prompt or self.PROMPT
     repl = CommandLoop(appcommands.GetCommandList(), prompt=prompt)
     print('Welcome! (Type help for more information.)')
     while True:
         try:
             repl.cmdloop()
             break
         except KeyboardInterrupt:
             print()
     return repl.last_return_code
コード例 #2
0
def main(unused_argv):
    bq.Factory.SetBigqueryClientFactory(
        encrypted_bigquery_client.EncryptedBigqueryClient)
    ebq_commands = {
        'load': _Load,
        'mk': _Make,
        'query': _Query,
        'show': _Show,
        'update': _Update,
        'version': _Version,
    }
    for command, function in ebq_commands.items():
        if command not in appcommands.GetCommandList():
            appcommands.AddCmd(command, function)
    # the __main__ module rewrite in run_main() or bq.run_main() etc only
    # works once and should only be run in the top-most setuptools entry_point
    # target.
    bq.main(unused_argv)