~ubuntu-branches/debian/sid/grub2/sid-200907171837

« back to all changes in this revision

Viewing changes to commands/echo.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2009-07-02 13:23:51 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702132351-tanpn0ryyijp93gu
Tags: 1.96+20090702-1
* New SVN snapshot.
* rules: Remove duplicated files in sparc64-ieee1275 port.
* rules: Comment out -DGRUB_ASSUME_LINUX_HAS_FB_SUPPORT=1 setting.  We'll
  re-evaluate using it when it's more mature.  (Closes: #535026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
19
 
20
 
#include <grub/normal.h>
21
20
#include <grub/dl.h>
22
 
#include <grub/arg.h>
23
21
#include <grub/misc.h>
 
22
#include <grub/extcmd.h>
24
23
 
25
24
static const struct grub_arg_option options[] =
26
25
  {
29
28
    {0, 0, 0, 0, 0, 0}
30
29
  };
31
30
 
32
 
 
33
31
static grub_err_t
34
 
grub_cmd_echo (struct grub_arg_list *state, int argc, char **args)
 
32
grub_cmd_echo (grub_extcmd_t cmd, int argc, char **args)
35
33
{
 
34
  struct grub_arg_list *state = cmd->state;
36
35
  int newline = 1;
37
36
  int i;
38
37
 
91
90
              arg++;
92
91
              continue;
93
92
            }
94
 
          
 
93
 
95
94
          /* This was not an escaped character, or escaping is not
96
95
             enabled.  */
97
96
          grub_printf ("%c", *arg);
109
108
  return 0;
110
109
}
111
110
 
 
111
static grub_extcmd_t cmd;
112
112
 
113
113
GRUB_MOD_INIT(echo)
114
114
{
115
 
  (void) mod;                   /* To stop warning. */
116
 
  grub_register_command ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH,
117
 
                         "echo [-e|-n] FILE", "Display a line of text.",
118
 
                         options);
 
115
  cmd = grub_register_extcmd ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH,
 
116
                              "echo [-e|-n] STRING", "Display a line of text.",
 
117
                              options);
119
118
}
120
119
 
121
120
GRUB_MOD_FINI(echo)
122
121
{
123
 
  grub_unregister_command ("echo");
 
122
  grub_unregister_extcmd (cmd);
124
123
}