'scaninfo <sid> [-c]
Get status information for scan ID <sid>, optionally also its
configuration if -c is supplied.'

def do_scaninfo(self, line):

    c = self.myparseline(line)
    if (len(c[0]) < 1):
        self.edprint('Invalid    syntax.')
        return
    sid = c[0][0]
    d = self.request(((self.ownopts['cli.server_baseurl'] + '/scanopts?id=') + sid))
    if (not d):
        return
    j = json.loads(d)
    if (len(j) == 0):
        self.dprint('No    such    scan    exists.')
        return
    out = (('Name:    ' + j['meta'][0]) + '\n')
    out += (('ID:    ' + sid) + '\n')
    out += (('Target:    ' + j['meta'][1]) + '\n')
    out += (('Started:    ' + j['meta'][3]) + '\n')
    out += (('Completed:    ' + j['meta'][4]) + '\n')
    out += (('Status:    ' + j['meta'][5]) + '\n')
    if ('-c' in c[0]):
        out += 'Configuration:\n'
        for k in sorted(j['config']):
            out += (((('        ' + k) + '    =    ') + j['config'][k]) + '\n')
    self.send_output(out, line, total=False, raw=True)
