1# DExTer : Debugging Experience Tester
2# ~~~~~~   ~         ~~         ~   ~~
3#
4# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5# See https://llvm.org/LICENSE.txt for license information.
6# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7"""A Command that specifies the command line with which to run the test.
8"""
9
10from dex.command.CommandBase import CommandBase
11
12class DexCommandLine(CommandBase):
13    def __init__(self, the_cmdline):
14        if type(the_cmdline) is not list:
15            raise TypeError('Expected list, got {}'.format(type(the_cmdline)))
16        for x in the_cmdline:
17          if type(x) is not str:
18              raise TypeError('Command line element "{}" has type {}'.format(x, type(x)))
19        self.the_cmdline = the_cmdline
20        super(DexCommandLine, self).__init__()
21
22    def eval(self):
23        raise NotImplementedError('DexCommandLine commands cannot be evaled.')
24
25    @staticmethod
26    def get_name():
27        return __class__.__name__
28
29    @staticmethod
30    def get_subcommands() -> dict:
31        return None
32