<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_command(options, vexrc, environ):
 """Get a command to run. :returns: a list of strings representing a command to be passed to Popen. """

    command = options.rest
    if not command:
        command = vexrc.get_shell(environ)
    if command and command[0].startswith('--'):
        raise exceptions.InvalidCommand(
            "don't put flags like '%s' after the virtualenv name."
            % command[0])
    if not command:
        raise exceptions.InvalidCommand("no command given")
    return command