mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
mirror: show help if no URL is provided
This commit is contained in:
parent
2162703a1a
commit
d5481927f2
1 changed files with 6 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue