mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-04 02:00:11 +02:00
mirror: show help if no URL is provided
This commit is contained in:
parent
2162703a1a
commit
d5481927f2
@ -23,7 +23,7 @@ options = None
|
|||||||
def main():
|
def main():
|
||||||
global options
|
global options
|
||||||
|
|
||||||
parser = ArgumentParser(usage="%(prog)s [options] url")
|
parser = ArgumentParser(usage=_("%(prog)s [options] url"))
|
||||||
common.setup_global_opts(parser)
|
common.setup_global_opts(parser)
|
||||||
parser.add_argument("url", nargs='?', help=_("Base URL to mirror"))
|
parser.add_argument("url", nargs='?', help=_("Base URL to mirror"))
|
||||||
parser.add_argument("--archive", action='store_true', default=False,
|
parser.add_argument("--archive", action='store_true', default=False,
|
||||||
@ -32,6 +32,11 @@ def main():
|
|||||||
help=_("The directory to write the mirror to"))
|
help=_("The directory to write the mirror to"))
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|
||||||
|
if options.url is None:
|
||||||
|
logging.error(_('A URL is required as an argument!') + '\n')
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
baseurl = options.url
|
baseurl = options.url
|
||||||
basedir = options.output_dir
|
basedir = options.output_dir
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user