mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-14 00:21:08 +00:00
404main: Return non-zero when arguments don't parse.
This commit is contained in:
parent
34b1991bdd
commit
f74f07507b
11
404main
11
404main
@ -104,15 +104,20 @@ def find_main(cache, pack):
|
||||
|
||||
process_deps(cache, deps)
|
||||
|
||||
def usage(exit):
|
||||
print 'Usage: %s <package name> [<distribution>]' % sys.argv[0]
|
||||
sys.exit(exit)
|
||||
|
||||
def main():
|
||||
|
||||
global packages, distro
|
||||
|
||||
# Check if the amount of arguments is correct
|
||||
if len(sys.argv) < 2 or len(sys.argv) > 3 or sys.argv[1] in ('help', '-h', '--help'):
|
||||
print 'Usage: %s <package name> [<distribution>]' % sys.argv[0]
|
||||
sys.exit(0)
|
||||
if len(sys.argv) > 1 and sys.argv[1] in ('help', '-h', '--help'):
|
||||
usage(0)
|
||||
|
||||
if len(sys.argv) < 2 or len(sys.argv) > 3:
|
||||
usage(1)
|
||||
|
||||
cache = apt.cache.Cache()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user