#!/usr/bin/env python3
# summary: Add an installed terminal program to Apps.
"""Add an installed terminal program to Apps.

usage: starchaser terminalapp show | add NAME COMMAND [ICON] | list | remove ID | launch ID
COMMAND is a quoted program and its arguments, such as 'btop' or 'python3 -q'.
Shell operators need an explicit shell, such as 'bash -c "command; read"'.
ICON is an icon name, PNG/JPEG/ICO file, or http or https image address.
Removing an app removes its launcher and icon; the program and its files stay installed.
"""
import sys

from starchaser_personal_apps import main

if __name__ == '__main__':
    if any(a in ('--help', '-h') for a in sys.argv[1:]):
        print(__doc__)
        sys.exit(0)
    code = main('terminalapp', sys.argv[1:])
    if code is None:
        print(__doc__, file=sys.stderr)
        code = 2
    sys.exit(code)
