Print short help text and exit.
.RE
+.PP
+.B \-p, \-\-project PROJECT
+.RS 2
+Target OBS project.
+.RE
+
+
.\" ===========================================================================
.\" Commands descriptions
.\" ===========================================================================
Print short help text about the "info" command and exit.
.RE
-.PP
-\-p, \-\-project PROJECT
-.RS 2
-Target project name. Mandatory option.
-.RE
-
-
.\"
.\" The "accept" command description
.\"
Print short help text about the "accept" command and exit.
.RE
-.PP
-\-p, \-\-project PROJECT
-.RS 2
-Target project name. Mandatory option.
-.RE
-
.PP
\-comment COMMENT
.RS 2
Print short help text about the "reject" command and exit.
.RE
-.PP
-\-p, \-\-project PROJECT
-.RS 2
-Target project name. Mandatory option.
-.RE
-
.PP
\-comment COMMENT
.RS 2
Print short help text about the "group" command and exit.
.RE
-.PP
-\-p, \-\-project PROJECT
-.RS 2
-Target project name. Mandatory option.
-.RE
-
.PP
\-comment COMMENT
.RS 2
Print short help text about the "rmgroup" command and exit.
.RE
-.PP
-\-p, \-\-project PROJECT
-.RS 2
-Target project name. Mandatory option.
-.RE
-
.SH BUGS
Please, report bugs to Ed Bartosh <eduard.bartosh@intel.com>.
def add_arguments(parser, _config):
"""Adds arguments to the parser. Called from [sub_]main."""
parser.add_argument('submission', help='submission or group')
- parser.add_argument('-p', '--project', help='target project',
- required=True)
parser.add_argument('-c', '--comment', help='comment', default='')
@staticmethod
"""Adds arguments to the parser. Called from [sub_]main."""
parser.add_argument('submission', nargs='+',
help='space separated list of submissions')
- parser.add_argument('-p', '--project', help='target project',
- required=True)
parser.add_argument('-c', '--comment', help='comment', default='')
parser.add_argument('-f', '--force', action='store_true',
help='force group creation')
Set defaults for arguments from config.
"""
parser.add_argument('submission', help='submission or group')
- parser.add_argument('-p', '--project', help='target project',
- required=True)
@staticmethod
def run(argv):
version='%(prog)s version 0.2~0.dev')
parser.add_argument('-s', '--section', default='general',
help='config section to use')
- # Define subcommands using setup.py entry points
+ parser.add_argument('-p', '--project', help='target project',
+ default=config.get('project'))
+
subparsers = parser.add_subparsers(help='sub-command help')
for entry in pkg_resources.iter_entry_points(group='repa_commands'):
cmd = entry.load()()
def read_config(paths=('/etc/repa.conf', expanduser('~/.repa.conf')),
section='general',
- mandatory=('apiurl', 'apiuser', 'apipasswd')):
+ mandatory=('apiurl', 'apiuser', 'apipasswd', 'project')):
"""
Read repa config.
Configuration is read from the set of files provided.
def add_arguments(parser, _config):
"""Adds arguments to the parser. Called from [sub_]main."""
parser.add_argument('submission', help='submission or group')
- parser.add_argument('-p', '--project', help='target project',
- required=True)
parser.add_argument('-c', '--comment', help='comment', default='')
@staticmethod
def add_arguments(parser, _config):
"""Adds arguments to the parser. Called from [sub_]main."""
parser.add_argument('group', help='group of submissions')
- parser.add_argument('-p', '--project', help='target project',
- required=True)
@staticmethod
def run(argv):