2 The B{0install add} command-line interface.
5 # Copyright (C) 2012, Thomas Leonard
6 # See the README file for details, or visit http://0install.net.
8 from __future__
import print_function
12 from zeroinstall
.cmd
import UsageError
, select
13 from zeroinstall
.injector
import model
, requirements
15 syntax
= "PET-NAME INTERFACE"
17 def add_options(parser
):
18 select
.add_options(parser
)
20 def handle(config
, options
, args
):
25 iface_uri
= model
.canonical_iface_uri(args
[1])
27 sels
= select
.get_selections(config
, options
, iface_uri
, select_only
= False, download_only
= True, test_callback
= None)
29 sys
.exit(1) # Aborted by user
31 r
= requirements
.Requirements(iface_uri
)
32 r
.parse_options(options
)
34 app
= config
.app_mgr
.create_app(pet_name
, r
)
35 app
.set_selections(sels
)
36 app
.integrate_shell(pet_name
)