Added <command glob='...'> to support Debian multi-arch Java packages
[zeroinstall.git] / zeroinstall / cmd / download.py
blob0a880a976b03cf19af382439ee31f3d1bdb987d6
1 """
2 The B{0install download} command-line interface.
3 """
5 # Copyright (C) 2011, Thomas Leonard
6 # See the README file for details, or visit http://0install.net.
8 import sys
10 from zeroinstall import _
11 from zeroinstall.cmd import UsageError, select
12 from zeroinstall.injector import model
14 syntax = "URI"
16 def add_options(parser):
17 select.add_options(parser)
18 parser.add_option("", "--show", help=_("show where components are installed"), action='store_true')
20 def handle(config, options, args):
21 if len(args) != 1:
22 raise UsageError()
23 iface_uri = model.canonical_iface_uri(args[0])
25 sels = select.get_selections(config, options, iface_uri,
26 select_only = False, download_only = True, test_callback = None)
27 if not sels:
28 sys.exit(1) # Aborted by user
30 if options.xml:
31 select.show_xml(sels)
32 if options.show:
33 select.show_human(sels, config.stores)