public static function fromYamlString($yml, $config_yml = null)
    {
        $parser = new sfYamlParser();

        $yml_tree = $parser->parse($yml);

        if ($config_yml) {
            $yml_config_tree = $parser->parse($config_yml);
            self::mergeDefaultsIntoYml($yml_tree, $yml_config_tree);
        }

        $cmd = self::ymlToCmd($yml_tree);
        $cmd = self::ymlParseOptions($yml_tree, $cmd);
        $cmd = self::ymlParseArguments($yml_tree, $cmd);
        $cmd = self::ymlParseCommands($yml_tree, $cmd);

        return $cmd;
    }