remake  4.3+dbg-1.5
chdir.h
Go to the documentation of this file.
1 /* Write commands associated with a given target. */
2 /*
3 Copyright (C) 2011 R. Bernstein <rocky@gnu.org>
4 This file is part of GNU Make (remake variant).
5 
6 GNU Make is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10 
11 GNU Make is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GNU Make; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20 /* Comment line - ingore text on line. */
21 static debug_return_t
22 dbg_cmd_chdir (char *psz_args)
23 {
24  if (!psz_args || 0==strlen(psz_args)) {
25  printf(_("Argument required (new working directory).\n"));
26  } else {
27  if ( 0 != chdir(psz_args) ) {
28  printf("%s: %s\n", psz_args, strerror(1));
29  } else {
30  printf (_("Working directory %s.\n"), psz_args);
31  }
32  }
33  return debug_readloop;
34 }
35 
36 static void
37 dbg_cmd_chdir_init(unsigned int c)
38 {
39  short_command[c].func = &dbg_cmd_chdir;
40  short_command[c].use = _("cd DIR");
41 }
42 
43 /*
44  * Local variables:
45  * eval: (c-set-style "gnu")
46  * indent-tabs-mode: nil
47  * End:
48  */
debug_return_t
Definition: trace.h:32
#define _(msgid)
Definition: make.h:293
Definition: trace.h:40