Пример #1
0
 def _construct_parser(self):
     usage = "%s <%s_%s> [arguments]" % (self.command, self.model_name, self.model.key_attribute)
     parser = arguments.get_parser_from_model(self.model,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     if self.include_storage_flag:
         arguments.add_storage_flag(parser, "create", self.model_name)
     return parser
Пример #2
0
 def _construct_parser(self):
     usage = "%s <%s_%s> [arguments]" % (self.command, self.model_name,
                                         self.model.key_attribute)
     parser = arguments.get_parser_from_model(self.model,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     if self.include_storage_flag:
         arguments.add_storage_flag(parser, "create", self.model_name)
     return parser
Пример #3
0
 def _construct_parser(self):
     usage = "%s <project_name> [arguments]" % self.command
     parser = arguments.get_parser_from_model(self.model,
                                              use_defaults=False,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     parser.add_argument('--new-name',
                         help="change the project's name",
                         metavar='<new_name>', 
                         dest='new_name',
                         default=arguments.SUPPRESS)
     parser.add_argument('--add',
                         help="Add target, application, or measurement configurations to the project",
                         metavar='<conf>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--remove',
                         help="Remove target, application, or measurement configurations from the project",
                         metavar='<conf>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--add-targets',
                         help="Add target configurations to the project",
                         metavar='<target>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--add-applications',
                         help="Add application configurations to the project",
                         metavar='<application>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--add-measurements',
                         help="Add measurement configurations to the project",
                         metavar='<measurement>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--remove-targets',
                         help="Remove target configurations from the project",
                         metavar='<target>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--remove-applications',
                         help="Remove application configurations from the project",
                         metavar='<application>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument('--remove-measurements',
                         help="Remove measurement configurations from the project",
                         metavar='<measurement>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     return parser
Пример #4
0
 def _construct_parser(self):
     usage = "%s [arguments] [--] <command> [command_arguments]" % self.command
     parser = arguments.get_parser_from_model(Trial, prog=self.command, usage=usage, description=self.summary,
                                              positional_primary_key=False)
     parser.add_argument('cmd',
                         help="Executable command, e.g. './a.out'",
                         metavar='<command>')
     parser.add_argument('cmd_args', 
                         help="Executable command arguments",
                         metavar='[command_arguments]',
                         nargs=arguments.REMAINDER)
     return parser
Пример #5
0
 def _construct_parser(self):
     key_attr = self.model.key_attribute
     usage = ("%s <%s_%s> <copy_%s> [arguments]" % (self.command, self.model_name, key_attr, key_attr))       
     parser = arguments.get_parser_from_model(self.model,
                                              use_defaults=False,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     group = parser.add_argument_group('%s arguments' % self.model_name)
     group.add_argument('copy_%s' % key_attr,
                        help="new %s configuration's %s" % (self.model_name, key_attr),
                        metavar='<copy_%s>' % key_attr,
                        default=arguments.SUPPRESS)
     if self.include_storage_flag:
         arguments.add_storage_flag(parser, "copy", self.model_name)
     return parser
Пример #6
0
 def _construct_parser(self):
     key_attr = self.model.key_attribute
     usage = "%s <%s_%s> [arguments]" % (self.command, self.model_name, key_attr)       
     parser = arguments.get_parser_from_model(self.model,
                                              use_defaults=False,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     if self.include_new_key_flag:
         group = parser.add_argument_group('%s arguments' % self.model_name)
         group.add_argument('--new-%s' % key_attr,
                            help="change the configuration's %s" % key_attr,
                            metavar='<new_%s>' % key_attr, 
                            dest='new_key',
                            default=arguments.SUPPRESS)
     if self.include_storage_flag:
         arguments.add_storage_flag(parser, "modify", self.model_name)
     return parser
Пример #7
0
 def _construct_parser(self):
     key_attr = self.model.key_attribute
     usage = ("%s <%s_%s> <copy_%s> [arguments]" %
              (self.command, self.model_name, key_attr, key_attr))
     parser = arguments.get_parser_from_model(self.model,
                                              use_defaults=False,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     group = parser.add_argument_group('%s arguments' % self.model_name)
     group.add_argument('copy_%s' % key_attr,
                        help="new %s configuration's %s" %
                        (self.model_name, key_attr),
                        metavar='<copy_%s>' % key_attr,
                        default=arguments.SUPPRESS)
     if self.include_storage_flag:
         arguments.add_storage_flag(parser, "copy", self.model_name)
     return parser
Пример #8
0
 def _construct_parser(self):
     key_attr = self.model.key_attribute
     usage = "%s <%s_%s> [arguments]" % (self.command, self.model_name,
                                         key_attr)
     parser = arguments.get_parser_from_model(self.model,
                                              use_defaults=False,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     if self.include_new_key_flag:
         group = parser.add_argument_group('%s arguments' % self.model_name)
         group.add_argument('--new-%s' % key_attr,
                            help="change the configuration's %s" % key_attr,
                            metavar='<new_%s>' % key_attr,
                            dest='new_key',
                            default=arguments.SUPPRESS)
     if self.include_storage_flag:
         arguments.add_storage_flag(parser, "modify", self.model_name)
     return parser
Пример #9
0
 def _construct_parser(self):
     usage = "%s <project_name> [targets] [applications] [measurements] [arguments]" % self.command
     parser = arguments.get_parser_from_model(self.model,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     parser.add_argument('impl_targets',
                         help="Target configurations in this project",
                         metavar='[targets]',
                         nargs='*',
                         default=arguments.SUPPRESS)
     parser.add_argument('impl_applications',
                         help="Application configurations in this project",
                         metavar='[applications]',
                         nargs='*',
                         default=arguments.SUPPRESS)
     parser.add_argument('impl_measurements',
                         help="Measurement configurations in this project",
                         metavar='[measurements]',
                         nargs='*',
                         default=arguments.SUPPRESS)
     parser.add_argument('--targets',
                         help="Target configurations in this project",
                         metavar='t',
                         nargs='+',
                         default=arguments.SUPPRESS,
                         dest='target')
     parser.add_argument('--applications',
                         help="Application configurations in this project",
                         metavar='a',
                         nargs='+',
                         default=arguments.SUPPRESS,
                         dest='application')
     parser.add_argument('--measurements',
                         help="Measurement configurations in this project",
                         metavar='m',
                         nargs='+',
                         default=arguments.SUPPRESS,
                         dest='measurement')
     return parser
Пример #10
0
 def _construct_parser(self):
     usage = "%s <project_name> [targets] [applications] [measurements] [arguments]" % self.command
     parser = arguments.get_parser_from_model(self.model, prog=self.command, usage=usage, description=self.summary)
     parser.add_argument('impl_targets',
                         help="Target configurations in this project",
                         metavar='[targets]',
                         nargs='*',
                         default=arguments.SUPPRESS)
     parser.add_argument('impl_applications',
                         help="Application configurations in this project",
                         metavar='[applications]',
                         nargs='*',
                         default=arguments.SUPPRESS)
     parser.add_argument('impl_measurements',
                         help="Measurement configurations in this project",
                         metavar='[measurements]',
                         nargs='*',
                         default=arguments.SUPPRESS)
     parser.add_argument('--targets',
                         help="Target configurations in this project",
                         metavar='t',
                         nargs='+',
                         default=arguments.SUPPRESS,
                         dest='target')
     parser.add_argument('--applications',
                         help="Application configurations in this project",
                         metavar='a',
                         nargs='+',
                         default=arguments.SUPPRESS,
                         dest='application')
     parser.add_argument('--measurements',
                         help="Measurement configurations in this project",
                         metavar='m',
                         nargs='+',
                         default=arguments.SUPPRESS,
                         dest='measurement')
     return parser
Пример #11
0
 def _construct_parser(self):
     usage = "%s <project_name> [arguments]" % self.command
     parser = arguments.get_parser_from_model(self.model,
                                              use_defaults=False,
                                              prog=self.command,
                                              usage=usage,
                                              description=self.summary)
     parser.add_argument('--new-name',
                         help="change the project's name",
                         metavar='<new_name>',
                         dest='new_name',
                         default=arguments.SUPPRESS)
     parser.add_argument(
         '--add',
         help=
         "Add target, application, or measurement configurations to the project",
         metavar='<conf>',
         nargs='+',
         default=arguments.SUPPRESS)
     parser.add_argument(
         '--remove',
         help=
         "Remove target, application, or measurement configurations from the project",
         metavar='<conf>',
         nargs='+',
         default=arguments.SUPPRESS)
     parser.add_argument('--add-targets',
                         help="Add target configurations to the project",
                         metavar='<target>',
                         nargs='+',
                         default=arguments.SUPPRESS)
     parser.add_argument(
         '--add-applications',
         help="Add application configurations to the project",
         metavar='<application>',
         nargs='+',
         default=arguments.SUPPRESS)
     parser.add_argument(
         '--add-measurements',
         help="Add measurement configurations to the project",
         metavar='<measurement>',
         nargs='+',
         default=arguments.SUPPRESS)
     parser.add_argument(
         '--remove-targets',
         help="Remove target configurations from the project",
         metavar='<target>',
         nargs='+',
         default=arguments.SUPPRESS)
     parser.add_argument(
         '--remove-applications',
         help="Remove application configurations from the project",
         metavar='<application>',
         nargs='+',
         default=arguments.SUPPRESS)
     parser.add_argument(
         '--remove-measurements',
         help="Remove measurement configurations from the project",
         metavar='<measurement>',
         nargs='+',
         default=arguments.SUPPRESS)
     return parser