/* pwd - print current directory
- Copyright (C) 1994-1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997, 1999-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <sys/types.h>
#include "system.h"
-#include "closeout.h"
#include "long-options.h"
#include "error.h"
+#include "xgetcwd.h"
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "pwd"
-#define AUTHORS "Jim Meyering"
-
-char *xgetcwd ();
+#define WRITTEN_BY _("Written by Jim Meyering.")
/* The name this program was run with. */
char *program_name;
{
char *wd;
+ initialize_main (&argc, &argv);
program_name = argv[0];
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
atexit (close_stdout);
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
- AUTHORS, usage);
+ WRITTEN_BY, usage);
- if (argc != 1)
+ if (1 < argc)
error (0, 0, _("ignoring non-option arguments"));
wd = xgetcwd ();
error (EXIT_FAILURE, errno, _("cannot get current directory"));
printf ("%s\n", wd);
- exit (0);
+ exit (EXIT_SUCCESS);
}