#!/usr/bin/env python3
#
# Convert a test specification to command-line options

import pscheduler

from validate import spec_is_valid


spec = pscheduler.json_load(exit_on_error=True, max_schema=1)

valid, message = spec_is_valid(spec)

if not valid:
    pscheduler.fail(message)

result = pscheduler.speccli_build_args(spec, 
                                       strings=[
        ( 'duration', 'duration' ),
        ( 'host', 'host' ),
        ( 'starting-comment', 'starting-comment' ),
        ( 'parting-comment', 'parting-comment' ),
        ])

pscheduler.succeed_json(result)
