#!/usr/bin/python3 -s
import shlex
import subprocess
from l3tlib.command import L3tIncidentCommand
from l3tlib.template import format


class Privatize(L3tIncidentCommand):

    descr = """Privatizes an incident

(This is not supported by the SG API, so you will be directed to the SG web
interface.)
"""

    def run(self):
        incident = self.l3t.get_incident(self.opts.incident, self.opts.bug)
        raw_cmd = format(self.config.l3t.incident_privatize_command,
                         incident=incident.id)
        args = shlex.split(raw_cmd)
        subprocess.call(args)


Privatize().main()
