Added "0install apps"
[zeroinstall.git] / zeroinstall / cmd / apps.py
blobd0eef853c2f3b9d13e0cbc78189e96fff394b476
1 """
2 The B{0install apps} command-line interface.
3 """
5 # Copyright (C) 2012, Thomas Leonard
6 # See the README file for details, or visit http://0install.net.
8 from __future__ import print_function
10 import sys
12 from zeroinstall.cmd import UsageError
13 from zeroinstall import helpers
15 syntax = ""
17 def add_options(parser):
18 pass
20 def handle(config, options, args):
21 if len(args) != 0:
22 raise UsageError()
24 result = helpers.get_selections_gui(None, ['--apps'], use_gui = options.gui)
25 if result is helpers.DontUseGUI:
26 apps = config.app_mgr.list_apps()
27 if apps:
28 for app in apps:
29 print(app.get_name())
30 else:
31 print('No apps. Use "0install add" to add some.')