Example #1
0
 def cmd(self, args=None, interact=True):
     """Processes command-line arguments."""
     if args is None:
         args = arguments.parse_args()
     else:
         args = arguments.parse_args(args)
     self.exit_code = 0
     with self.handling_exceptions():
         self.use_args(args, interact)
     self.exit_on_error()
Example #2
0
 def cmd(self, args=None, interact=True):
     """Process command-line arguments."""
     if args is None:
         parsed_args = arguments.parse_args()
     else:
         parsed_args = arguments.parse_args(args)
     self.exit_code = 0
     with self.handling_exceptions():
         self.use_args(parsed_args, interact, original_args=args)
     self.exit_on_error()
Example #3
0
 def cmd(self, args=None, argv=None, interact=True):
     """Process command-line arguments."""
     if args is None:
         parsed_args = arguments.parse_args()
     else:
         parsed_args = arguments.parse_args(args)
     if argv is not None:
         if parsed_args.argv is not None:
             raise CoconutException("cannot pass --argv/--args when using coconut-run (coconut-run interprets any arguments after the source file as --argv/--args)")
         parsed_args.argv = argv
     self.exit_code = 0
     with self.handling_exceptions():
         self.use_args(parsed_args, interact, original_args=args)
     self.exit_on_error()
Example #4
0
 def start(self):
     """Processes command-line arguments."""
     self.cmd(arguments.parse_args())