mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-28 09:11:38 +00:00
*-distro-info: parser.error() will exit.
This commit is contained in:
parent
fd5da7c92b
commit
7d6f5ecb56
@ -56,14 +56,12 @@ def main():
|
|||||||
|
|
||||||
if len(args) != 0:
|
if len(args) != 0:
|
||||||
parser.error("This script does not take any additional parameters.")
|
parser.error("This script does not take any additional parameters.")
|
||||||
return 1
|
|
||||||
|
|
||||||
versions = [options.all, options.devel, options.old, options.stable,
|
versions = [options.all, options.devel, options.old, options.stable,
|
||||||
options.supported, options.testing, options.unsupported]
|
options.supported, options.testing, options.unsupported]
|
||||||
if len([x for x in versions if x]) != 1:
|
if len([x for x in versions if x]) != 1:
|
||||||
parser.error("You have to select exactly one of --all, --devel, --old, "
|
parser.error("You have to select exactly one of --all, --devel, --old, "
|
||||||
"--stable, --supported, --testing, --unsupported.")
|
"--stable, --supported, --testing, --unsupported.")
|
||||||
return 1
|
|
||||||
|
|
||||||
if options.date is None:
|
if options.date is None:
|
||||||
date = None
|
date = None
|
||||||
@ -73,7 +71,6 @@ def main():
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
parser.error("Option --date needs to be an date in ISO 8601 "
|
parser.error("Option --date needs to be an date in ISO 8601 "
|
||||||
"format.")
|
"format.")
|
||||||
return 1
|
|
||||||
|
|
||||||
if options.all:
|
if options.all:
|
||||||
for distro in DebianDistroInfo().all:
|
for distro in DebianDistroInfo().all:
|
||||||
@ -92,7 +89,6 @@ def main():
|
|||||||
elif options.unsupported:
|
elif options.unsupported:
|
||||||
for distro in DebianDistroInfo().unsupported(date):
|
for distro in DebianDistroInfo().unsupported(date):
|
||||||
print distro
|
print distro
|
||||||
return 0
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(main())
|
main()
|
||||||
|
@ -53,14 +53,12 @@ def main():
|
|||||||
|
|
||||||
if len(args) != 0:
|
if len(args) != 0:
|
||||||
parser.error("This script does not take any additional parameters.")
|
parser.error("This script does not take any additional parameters.")
|
||||||
return 1
|
|
||||||
|
|
||||||
versions = [options.all, options.devel, options.lts, options.stable,
|
versions = [options.all, options.devel, options.lts, options.stable,
|
||||||
options.supported, options.unsupported]
|
options.supported, options.unsupported]
|
||||||
if len([x for x in versions if x]) != 1:
|
if len([x for x in versions if x]) != 1:
|
||||||
parser.error("You have to select exactly one of --all, --devel, --lts, "
|
parser.error("You have to select exactly one of --all, --devel, --lts, "
|
||||||
"--stable, --supported, --unsupported.")
|
"--stable, --supported, --unsupported.")
|
||||||
return 1
|
|
||||||
|
|
||||||
if options.date is None:
|
if options.date is None:
|
||||||
date = None
|
date = None
|
||||||
@ -70,7 +68,6 @@ def main():
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
parser.error("Option --date needs to be an date in ISO 8601 "
|
parser.error("Option --date needs to be an date in ISO 8601 "
|
||||||
"format.")
|
"format.")
|
||||||
return 1
|
|
||||||
|
|
||||||
if options.all:
|
if options.all:
|
||||||
for distro in UbuntuDistroInfo().all:
|
for distro in UbuntuDistroInfo().all:
|
||||||
@ -87,7 +84,6 @@ def main():
|
|||||||
elif options.unsupported:
|
elif options.unsupported:
|
||||||
for distro in UbuntuDistroInfo().unsupported(date):
|
for distro in UbuntuDistroInfo().unsupported(date):
|
||||||
print distro
|
print distro
|
||||||
return 0
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(main())
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user