Revision 2983460b

View differences:

client/client.c
76 76
extern void _rl_move_vert(int);
77 77
extern Function *rl_last_func;
78 78

  
79
static int
80
handle_internal_command(char *cmd)
81
{
82
  if (!strncmp(cmd, "exit", 4) || !strncmp(cmd, "quit", 4))
83
    {
84
      cleanup();
85
      exit(0);
86
    }
87
  if (!strncmp(cmd, "help", 4))
88
    {
89
      puts("Press `?' for context sensitive help.");
90
      return 1;
91
    }
92
  return 0;
93
}
94

  
79 95
static void
80 96
got_line(char *cmd_buffer)
81 97
{
......
92 108
      if (cmd)
93 109
	{
94 110
	  add_history(cmd);
95
	  if (!strcmp(cmd, "exit") || !strcmp(cmd, "quit"))
111
	  if (!handle_internal_command(cmd))
96 112
	    {
97
	      cleanup();
98
	      exit(0);
113
	      server_send(cmd);
114
	      input_hidden = -1;
115
	      io_loop(0);
116
	      input_hidden = 0;
99 117
	    }
100
	  server_send(cmd);
101
	  input_hidden = -1;
102
	  io_loop(0);
103
	  input_hidden = 0;
104 118
	  free(cmd);
105 119
	}
106 120
      else
client/cmds.m4
8 8

  
9 9
CF_CLI(QUIT,,, [[Quit the client]])
10 10
CF_CLI(EXIT,,, [[Exit the client]])
11
CF_CLI(HELP,,, [[Description of the help system]])
client/commands.c
294 294
    }
295 295
  if (!n->cmd)
296 296
    {
297
      puts("No such command.");
297
      puts("No such command. Press `?' for help.");
298 298
      return NULL;
299 299
    }
300 300
  b = xmalloc(strlen(n->cmd->command) + strlen(args) + 1);

Also available in: Unified diff