| 1 | /* Copyright (C) 2004-2005, 2007-2009, 2011, 2020 R. Bernstein |
| 2 | <[email protected]> |
| 3 | This file is part of GNU Make (remake variant). |
| 4 | |
| 5 | GNU Make is free software; you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation; either version 2, or (at your option) |
| 8 | any later version. |
| 9 | |
| 10 | GNU Make is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with GNU Make; see the file COPYING. If not, write to |
| 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 18 | Boston, MA 02111-1307, USA. */ |
| 19 | |
| 20 | /** \file libdebugger/command/pwd.c |
| 21 | * |
| 22 | * \brief Debugger `pwd` command. |
| 23 | * |
| 24 | * Debugger command to the show the current working directory. |
| 25 | */ |
| 26 | |
| 27 | #include "../../src/trace.h" |
| 28 | |
| 29 | extern debug_return_t |
| 30 | dbg_cmd_pwd(char *psz_args) |
| 31 | { |
| 32 | if (!psz_args || 0==strlen(psz_args)) { |
| 33 | char wd[300]; |
| 34 | if (NULL == getcwd (wd, sizeof(wd))) { |
| 35 | printf (_("cannot get current directory %s\n"), strerror(errno)); |
| 36 | } else { |
| 37 | printf (_("Working directory %s.\n"), wd); |
| 38 | } |
| 39 | } else { |
| 40 | printf(_("The \"pwd\" command does not take an argument: %s\n"), psz_args); |
| 41 | } |
| 42 | |
| 43 | return debug_readloop; |
| 44 | } |
| 45 | |
| 46 | /* |
| 47 | * Local variables: |
| 48 | * eval: (c-set-style "gnu") |
| 49 | * indent-tabs-mode: nil |
| 50 | * End: |
| 51 | */ |