1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

mirror: show help if no URL is provided

This commit is contained in:
Hans-Christoph Steiner 2017-11-29 14:59:48 +01:00
parent 2162703a1a
commit d5481927f2

View File

@ -23,7 +23,7 @@ options = None
def main():
global options
parser = ArgumentParser(usage="%(prog)s [options] url")
parser = ArgumentParser(usage=_("%(prog)s [options] url"))
common.setup_global_opts(parser)
parser.add_argument("url", nargs='?', help=_("Base URL to mirror"))
parser.add_argument("--archive", action='store_true', default=False,
@ -32,6 +32,11 @@ def main():
help=_("The directory to write the mirror to"))
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
basedir = options.output_dir