示例#1
0
static grub_err_t
test_blockarg (grub_extcmd_context_t ctxt, int argc, char **args)
{
  if (! ctxt->script)
    return grub_error (GRUB_ERR_BAD_ARGUMENT, "no block parameter");

  grub_printf ("%s\n", args[argc - 1]);
  grub_script_execute (ctxt->script);
  return GRUB_ERR_NONE;
}
示例#2
0
文件: main.c 项目: AlfredArouna/grub2
static grub_err_t
grub_normal_parse_line (char *line, grub_reader_getline_t getline)
{
  struct grub_script *parsed_script;

  /* Parse the script.  */
  parsed_script = grub_script_parse (line, getline);

  if (parsed_script)
    {
      /* Execute the command(s).  */
      grub_script_execute (parsed_script);

      /* The parsed script was executed, throw it away.  */
      grub_script_free (parsed_script);
    }

  return grub_errno;
}