mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
Config file support for grab-attachments (almost doubling its size) :P
This commit is contained in:
parent
eedb60b296
commit
86facf23c2
@ -2,7 +2,7 @@
|
||||
.SH NAME
|
||||
grab\-attachments \- downloads attachments from a Launchpad bug
|
||||
.SH SYNOPSIS
|
||||
.B grab\-attachments\fR <\fIbug-number\fR>
|
||||
.B grab\-attachments\fR [\fIoptions\fR] \fIbug-number\fR...
|
||||
.br
|
||||
.B grab\-attachments \-h
|
||||
.SH DESCRIPTION
|
||||
@ -12,13 +12,36 @@ Launchpad bug report into the current directory.
|
||||
.SH OPTIONS
|
||||
Listed below are the command line options for grab\-attachments:
|
||||
.TP
|
||||
.B \-h
|
||||
Display a help message and exit.
|
||||
.TP
|
||||
.B <bug-number>
|
||||
.I bug-number
|
||||
Specifies the Launchpad bug number that the script should download
|
||||
attachments from.
|
||||
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
Display a help message and exit.
|
||||
.TP
|
||||
.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
|
||||
Use the specified instance of Launchpad (e.g. "staging"), instead of
|
||||
the default of "production".
|
||||
.TP
|
||||
.B \-\-no\-conf
|
||||
Do not read any configuration files, or configuration from environment
|
||||
variables.
|
||||
.SH ENVIRONMENT
|
||||
All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
|
||||
environment variables.
|
||||
Variables in the environment take precedence to those in configuration
|
||||
files.
|
||||
.SH CONFIGURATION VARIABLES
|
||||
The following variables can be set in the environment or in
|
||||
.BR ubuntu\-dev\-tools (5)
|
||||
configuration files.
|
||||
In each case, the script\-specific variable takes precedence over the
|
||||
package\-wide variable.
|
||||
.TP
|
||||
.BR GRAB_ATTACHMENTS_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
|
||||
The default value for \fB--lpinstance\fR.
|
||||
.SH SEE ALSO
|
||||
.BR ubuntu\-dev\-tools (5)
|
||||
.SH AUTHOR
|
||||
\fBgrab\-attachments\fR was written by Daniel Holbach and this manual page
|
||||
was written by Jonathan Patrick Davies.
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Copyright (C) 2007, Canonical Ltd.
|
||||
# Written by Daniel Holbach
|
||||
# Written by Daniel Holbach,
|
||||
# Stefano Rivera
|
||||
#
|
||||
# ##################################################################
|
||||
#
|
||||
@ -22,18 +23,28 @@ from optparse import OptionParser
|
||||
import os
|
||||
import sys
|
||||
|
||||
from ubuntutools.config import UDTConfig
|
||||
from ubuntutools.lp.libsupport import get_launchpad
|
||||
|
||||
USAGE = "grab-attachments <bug numbers>"
|
||||
|
||||
def main():
|
||||
p = OptionParser('Usage: %prog [options] <bug numbers>')
|
||||
p.add_option('-l', '--lpinstance', metavar='INSTANCE',
|
||||
dest='lpinstance', default=None,
|
||||
help='Launchpad instance to connect to (default: production)')
|
||||
p.add_option('--no-conf',
|
||||
dest='no_conf', default=False, action='store_true',
|
||||
help="Don't read config files or environment variables")
|
||||
opts, args = p.parse_args()
|
||||
if len(args) < 1:
|
||||
p.error('No bug numbers provided')
|
||||
config = UDTConfig(opts.no_conf)
|
||||
if opts.lpinstance is None:
|
||||
opts.lpinstance = config.get_value('LPINSTANCE')
|
||||
|
||||
try:
|
||||
launchpad = get_launchpad("ubuntu-dev-tools")
|
||||
launchpad = get_launchpad("ubuntu-dev-tools", server=opts.lpinstance)
|
||||
|
||||
for arg in args:
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user