mode_string (mode, perms);
perms[10] = '\0'; /* `mode_string' does not null terminate. */
if (changed)
- printf ("mode of %s changed to %04o (%s)\n",
+ printf (_("mode of %s changed to %04o (%s)\n"),
file, mode & 07777, &perms[1]);
else
- printf ("mode of %s retained as %04o (%s)\n",
+ printf (_("mode of %s retained as %04o (%s)\n"),
file, mode & 07777, &perms[1]);
}
return 1;
}
else
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
}
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... MODE[,MODE]... FILE...\n\
or: %s [OPTION]... OCTAL_MODE FILE...\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
\n\
-c, --changes like verbose but report only when a change is made\n\
-f, --silent, --quiet suppress most error messages\n\
--version output version information and exit\n\
\n\
Each MODE is one or more of the letters ugoa, one of the symbols +-= and\n\
-one or more of the letters rwxXstugo.\n");
+one or more of the letters rwxXstugo.\n"));
}
exit (status);
}
case '-':
case '=':
if (modeind != 0 && modeind != thisind)
- error (1, 0, "invalid mode");
+ error (1, 0, _("invalid mode"));
modeind = thisind;
break;
case 'R':
if (optind >= argc)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
changes = mode_compile (argv[modeind],
MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS);
if (changes == MODE_INVALID)
- error (1, 0, "invalid mode");
+ error (1, 0, _("invalid mode"));
else if (changes == MODE_MEMORY_EXHAUSTED)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
for (; optind < argc; ++optind)
{
describe_change (char *file, int changed)
{
if (changed)
- printf ("owner of %s changed to ", file);
+ printf (_("owner of %s changed to "), file);
else
- printf ("owner of %s retained as ", file);
+ printf (_("owner of %s retained as "), file);
if (groupname)
printf ("%s.%s\n", username, groupname);
else
return 1;
}
else
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
}
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... OWNER[.[GROUP]] FILE...\n\
or: %s [OPTION]... .[GROUP] FILE...\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
\n\
-c, --changes be verbose whenever change occurs\n\
--version output version information and exit\n\
\n\
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
-to login group if implied by a period. A colon may replace the period.\n");
+to login group if implied by a period. A colon may replace the period.\n"));
}
exit (status);
}
if (optind >= argc - 1)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
#ifdef S_ISLNK
flag_symbolic_link = 1;
#else
- error (1, 0, "symbolic links are not supported on this system");
+ error (1, 0, _("symbolic links are not supported on this system"));
#endif
break;
usage (0, NULL);
if (flag_hard_link && flag_symbolic_link)
- usage (2, "cannot make both hard and symbolic links");
+ usage (2, _("cannot make both hard and symbolic links"));
if (make_backups)
backup_type = get_version (version);
int ret = 0;
if (optind >= argc)
- usage (2, "missing file arguments");
+ usage (2, _("missing file arguments"));
if (optind >= argc - 1)
- usage (2, "missing file argument");
+ usage (2, _("missing file argument"));
dest = argv[argc - 1];
struct stat source_stats;
if (flag_path)
- usage (2, "when preserving paths, last argument must be a directory");
+ usage (2, _("when preserving paths, last argument must be a directory"));
source = argv[optind];
}
else
usage (2,
- "when copying multiple files, last argument must be a directory");
+ _("when copying multiple files, last argument must be a directory"));
}
\f
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
if (S_ISDIR (src_type) && !flag_recursive)
{
- error (0, 0, "%s: omitting directory", src_path);
+ error (0, 0, _("%s: omitting directory"), src_path);
return 1;
}
if (flag_hard_link)
return 0;
- error (0, 0, "`%s' and `%s' are the same file",
+ error (0, 0, _("`%s' and `%s' are the same file"),
src_path, dst_path);
return 1;
}
if (S_ISDIR (dst_sb.st_mode))
{
error (0, 0,
- "%s: cannot overwrite directory with non-directory",
+ _("%s: cannot overwrite directory with non-directory"),
dst_path);
return 1;
}
{
if (euidaccess (dst_path, W_OK) != 0)
fprintf (stderr,
- "%s: overwrite `%s', overriding mode %04o? ",
+ _("%s: overwrite `%s', overriding mode %04o? "),
program_name, dst_path,
(unsigned int) (dst_sb.st_mode & 07777));
else
- fprintf (stderr, "%s: overwrite `%s'? ",
+ fprintf (stderr, _("%s: overwrite `%s'? "),
program_name, dst_path);
if (!yesno ())
return 0;
{
char *tmp_backup = find_backup_file_name (dst_path);
if (tmp_backup == NULL)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
dst_backup = (char *) alloca (strlen (tmp_backup) + 1);
strcpy (dst_backup, tmp_backup);
free (tmp_backup);
{
if (errno != ENOENT)
{
- error (0, errno, "cannot backup `%s'", dst_path);
+ error (0, errno, _("cannot backup `%s'"), dst_path);
return 1;
}
else
{
if (unlink (dst_path) && errno != ENOENT)
{
- error (0, errno, "cannot remove old link to `%s'",
+ error (0, errno, _("cannot remove old link to `%s'"),
dst_path);
return 1;
}
if (is_ancestor (&src_sb, ancestors))
{
- error (0, 0, "%s: cannot copy cyclic symbolic link", src_path);
+ error (0, 0, _("%s: cannot copy cyclic symbolic link"), src_path);
goto un_backup;
}
if (mkdir (dst_path, (src_mode & umask_kill) | 0700))
{
- error (0, errno, "cannot create directory `%s'", dst_path);
+ error (0, errno, _("cannot create directory `%s'"), dst_path);
goto un_backup;
}
else
{
error (0, 0,
- "%s: can only make relative symbolic links in current directory", dst_path);
+ _("%s: can only make relative symbolic links in current directory"), dst_path);
goto un_backup;
}
}
{
if (link (src_path, dst_path))
{
- error (0, errno, "cannot create link `%s'", dst_path);
+ error (0, errno, _("cannot create link `%s'"), dst_path);
goto un_backup;
}
return 0;
{
if (mkfifo (dst_path, src_mode & umask_kill))
{
- error (0, errno, "cannot create fifo `%s'", dst_path);
+ error (0, errno, _("cannot create fifo `%s'"), dst_path);
goto un_backup;
}
}
{
if (mknod (dst_path, src_mode & umask_kill, src_sb.st_rdev))
{
- error (0, errno, "cannot create special file `%s'", dst_path);
+ error (0, errno, _("cannot create special file `%s'"), dst_path);
goto un_backup;
}
}
link_size = readlink (src_path, link_val, PATH_MAX + 1);
if (link_size < 0)
{
- error (0, errno, "cannot read symbolic link `%s'", src_path);
+ error (0, errno, _("cannot read symbolic link `%s'"), src_path);
goto un_backup;
}
link_val[link_size] = '\0';
if (symlink (link_val, dst_path))
{
- error (0, errno, "cannot create symbolic link `%s'", dst_path);
+ error (0, errno, _("cannot create symbolic link `%s'"), dst_path);
goto un_backup;
}
return 0;
else
#endif
{
- error (0, 0, "%s: unknown file type", src_path);
+ error (0, 0, _("%s: unknown file type"), src_path);
goto un_backup;
}
if (dst_backup)
{
if (rename (dst_backup, dst_path))
- error (0, errno, "cannot un-backup `%s'", dst_path);
+ error (0, errno, _("cannot un-backup `%s'"), dst_path);
}
return 1;
}
new->is_new_dir = 1;
if (mkdir (dirpath, mode))
{
- error (0, errno, "cannot make directory `%s'", dirpath);
+ error (0, errno, _("cannot make directory `%s'"), dirpath);
return 1;
}
else
}
else if (!S_ISDIR (stats.st_mode))
{
- error (0, 0, "`%s' exists but is not a directory", dirpath);
+ error (0, 0, _("`%s' exists but is not a directory"), dirpath);
return 1;
}
else
else if (!S_ISDIR (stats.st_mode))
{
- error (0, 0, "`%s' exists but is not a directory", dst_dirname);
+ error (0, 0, _("`%s' exists but is not a directory"), dst_dirname);
return 1;
}
else
return -1;
}
else
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
}
namep = name_space;
dest_desc = open (dst_path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (dest_desc < 0)
{
- error (0, errno, "cannot create regular file `%s'", dst_path);
+ error (0, errno, _("cannot create regular file `%s'"), dst_path);
return_val = -1;
goto ret2;
}
error (1, errno, "%s", input_file);
}
else
- input_file = "standard input";
+ input_file = _("standard input");
if (input_fd == output_fd)
- error (1, 0, "standard %s is closed", input_fd == 0 ? "input" : "output");
+ error (1, 0, _("%s is closed"), (input_fd == 0
+ ? _("standard input")
+ : _("standard output")));
if (output_file != NULL)
{
#endif
}
else
- output_file = "standard output";
+ output_file = _("standard output");
#ifdef _POSIX_VERSION
sigaction (SIGINT, NULL, &sigact);
val = strchr (name, '=');
if (val == NULL)
{
- error (0, 0, "unrecognized option `%s'", name);
+ error (0, 0, _("unrecognized option `%s'"), name);
usage (1);
}
*val++ = '\0';
{
n = parse_integer (val);
if (n < 0)
- error (1, 0, "invalid number `%s'", val);
+ error (1, 0, _("invalid number `%s'"), val);
if (equal (name, "ibs"))
{
max_records = n;
else
{
- error (0, 0, "unrecognized option `%s=%s'", name, val);
+ error (0, 0, _("unrecognized option `%s=%s'"), name, val);
usage (1);
}
}
}
if (conversions[i].convname == NULL)
{
- error (0, 0, "%s: invalid conversion", str);
+ error (0, 0, _("%s: invalid conversion"), str);
usage (1);
}
str = new;
|| (MX (C_LCASE | C_UCASE) > 1)
|| (MX (C_UNBLOCK | C_SYNC) > 1))
{
- error (1, 0, "\
-only one conv in {ascii,ebcdic,ibm}, {lcase,ucase}, {block,unblock}, {unblock,sync}");
+ error (1, 0, _("\
+only one conv in {ascii,ebcdic,ibm}, {lcase,ucase}, {block,unblock}, {unblock,sync}"));
}
#undef MX
static void
print_stats (void)
{
- fprintf (stderr, "%u+%u records in\n", r_full, r_partial);
- fprintf (stderr, "%u+%u records out\n", w_full, w_partial);
+ fprintf (stderr, _("%u+%u records in\n"), r_full, r_partial);
+ fprintf (stderr, _("%u+%u records out\n"), w_full, w_partial);
if (r_truncate > 0)
- fprintf (stderr, "%u truncated record%s\n", r_truncate,
+ fprintf (stderr, _("%u truncated record%s\n"), r_truncate,
r_truncate == 1 ? "" : "s");
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]...\n"), program_name);
+ printf (_("\
Copy a file, converting and formatting according to the options.\n\
\n\
bs=BYTES force ibs=BYTES and obs=BYTES\n\
ucase change lower case to upper case\n\
swab swap every pair of input bytes\n\
noerror continue after read errors\n\
- sync pad every input block with NULs to ibs-size\n");
+ sync pad every input block with NULs to ibs-size\n"));
}
exit (status);
}
if (strcmp (i->fs_name, j->fs_name) == 0)
{
error (0, 0,
- "file system type `%s' both selected and excluded",
+ _("file system type `%s' both selected and excluded"),
i->fs_name);
match = 1;
break;
show_all_fs);
if (mount_list == NULL)
- error (1, errno, "cannot read table of mounted filesystems");
+ error (1, errno, _("cannot read table of mounted filesystems"));
print_header ();
if (require_sync)
return;
}
}
- error (0, 0, "cannot find mount point for %s", point);
+ error (0, 0, _("cannot find mount point for %s"), point);
exit_status = 1;
}
\f
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
+ printf (_("\
Show information about the filesystem on which each FILE resides,\n\
or all filesystems by default.\n\
\n\
-P, --portability use the POSIX output format\n\
-T, --print-type print filesystem type\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
program_name, reason);
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
+ printf (_("\
Summarize disk usage of each FILE, recursively for directories.\n\
\n\
-a, --all write counts for all files, not just directories\n\
-L, --dereference dereference all symbolic links\n\
-S, --separate-dirs do not include size of subdirectories\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
usage (0, NULL);
if (opt_all && opt_summarize_only)
- usage (2, "cannot both summarize and show all entries");
+ usage (2, _("cannot both summarize and show all entries"));
/* Initialize the hash structure for inode numbers. */
hash_init (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE);
/* Remember the inode and device number of the current directory. */
if (stat (".", &stat_buf))
- error (1, errno, "current directory");
+ error (1, errno, _("current directory"));
initial_ino = stat_buf.st_ino;
initial_dev = stat_buf.st_dev;
error (1, errno, ".");
if (stat_buf.st_ino != initial_ino || stat_buf.st_dev != initial_dev)
{
- if (restore_cwd (&cwd, "starting directory", NULL))
+ if (restore_cwd (&cwd, _("starting directory"), NULL))
exit (1);
}
}
if (opt_combined_arguments)
{
- printf ("%ld\ttotal\n", output_size == size_bytes ? tot_size
+ printf (_("%ld\ttotal\n"), output_size == size_bytes ? tot_size
: convert_blocks (tot_size, output_size == size_kilobytes));
fflush (stdout);
}
if (chdir (ent) < 0)
{
- error (0, errno, "cannot change to directory %s", path->text);
+ error (0, errno, _("cannot change to directory %s"), path->text);
exit_status = 1;
return 0;
}
free_cwd (&cwd);
}
else if (chdir ("..") < 0)
- error (1, errno, "cannot change to `..' from directory %s",
+ error (1, errno, _("cannot change to `..' from directory %s"),
path->text);
exit_status = 1;
return 0;
}
else
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
}
/* Remember the current path. */
}
else if (chdir ("..") < 0)
error (1, errno,
- "cannot change to `..' from directory %s", path->text);
+ _("cannot change to `..' from directory %s"), path->text);
str_trunc (path, pathlen - 1); /* Remove the "/" we added. */
if (!opt_summarize_only || top)
/* Check for invalid combinations of arguments. */
if (dir_arg && strip_files)
error (1, 0,
- "the strip option may not be used when installing a directory");
+ _("the strip option may not be used when installing a directory"));
if (optind == argc || (optind == argc - 1 && !dir_arg))
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
{
struct mode_change *change = mode_compile (symbolic_mode, 0);
if (change == MODE_INVALID)
- error (1, 0, "invalid mode `%s'", symbolic_mode);
+ error (1, 0, _("invalid mode `%s'"), symbolic_mode);
else if (change == MODE_MEMORY_EXHAUSTED)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
mode = mode_adjust (0, change);
}
}
if (!S_ISREG (from_stats.st_mode))
{
- error (0, 0, "`%s' is not a regular file", from);
+ error (0, 0, _("`%s' is not a regular file"), from);
return 1;
}
if (stat (to, &to_stats) == 0)
{
if (!S_ISREG (to_stats.st_mode))
{
- error (0, 0, "`%s' is not a regular file", to);
+ error (0, 0, _("`%s' is not a regular file"), to);
return 1;
}
if (from_stats.st_dev == to_stats.st_dev
&& from_stats.st_ino == to_stats.st_ino)
{
- error (0, 0, "`%s' and `%s' are the same file", from, to);
+ error (0, 0, _("`%s' and `%s' are the same file"), from, to);
return 1;
}
/* If unlink fails, try to proceed anyway. */
switch (pid)
{
case -1:
- error (1, errno, "cannot fork");
+ error (1, errno, _("cannot fork"));
break;
case 0: /* Child. */
execlp ("strip", "strip", path, (char *) NULL);
- error (1, errno, "cannot run strip");
+ error (1, errno, _("cannot run strip"));
break;
default: /* Parent. */
/* Parent process. */
if (pw == NULL)
{
if (!is_number (owner_name))
- error (1, 0, "invalid user `%s'", owner_name);
+ error (1, 0, _("invalid user `%s'"), owner_name);
/* FIXME: atoi won't warn about overflow. Use xstrtoul. */
/* FIXME: eliminate is_number altogether! */
owner_id = atoi (owner_name);
if (gr == NULL)
{
if (!is_number (group_name))
- error (1, 0, "invalid group `%s'", group_name);
+ error (1, 0, _("invalid group `%s'"), group_name);
/* FIXME: atoi won't warn about overflow. Use xstrtoul. */
group_id = atoi (group_name);
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... SOURCE DEST (1st format)\n\
or: %s [OPTION]... SOURCE... DIRECTORY (2nd format)\n\
or: %s -d [OPTION]... DIRECTORY... (3nd format)\n\
-",
+"),
program_name, program_name, program_name);
- printf ("\
+ printf (_("\
In first two formats, copy SOURCE to DEST or multiple SOURCE(s) to\n\
DIRECTORY, while setting permission modes and owner/group. In third\n\
format, make all components of the given DIRECTORY(ies).\n\
-o, --owner=OWNER set ownership (super-user only)\n\
-s, --strip strip symbol tables, only for 1st and 2nd formats\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
}
if (!hard_dir_link && S_ISDIR (source_stats.st_mode))
{
- error (0, 0, "%s: hard link not allowed for directory", source);
+ error (0, 0, _("%s: hard link not allowed for directory"), source);
return 1;
}
}
{
if (S_ISDIR (dest_stats.st_mode))
{
- error (0, 0, "%s: cannot overwrite directory", dest);
+ error (0, 0, _("%s: cannot overwrite directory"), dest);
return 1;
}
if (interactive)
{
- fprintf (stderr, "%s: replace `%s'? ", program_name, dest);
+ fprintf (stderr, _("%s: replace `%s'? "), program_name, dest);
if (!yesno ())
return 0;
}
else if (!remove_existing_files)
{
- error (0, 0, "%s: File exists", dest);
+ error (0, 0, _("%s: File exists"), dest);
return 1;
}
{
char *tmp_backup = find_backup_file_name (dest);
if (tmp_backup == NULL)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
dest_backup = (char *) alloca (strlen (tmp_backup) + 1);
strcpy (dest_backup, tmp_backup);
free (tmp_backup);
{
if (errno != ENOENT)
{
- error (0, errno, "cannot backup `%s'", dest);
+ error (0, errno, _("cannot backup `%s'"), dest);
return 1;
}
else
}
else if (unlink (dest) && errno != ENOENT)
{
- error (0, errno, "cannot remove `%s'", dest);
+ error (0, errno, _("cannot remove `%s'"), dest);
return 1;
}
}
return 0;
}
- error (0, errno, "cannot %slink `%s' to `%s'",
+ error (0, errno, _("cannot %slink `%s' to `%s'"),
#ifdef S_ISLNK
- symbolic_link ? "symbolic " : "",
+ symbolic_link ? _("symbolic ") : "",
#else
"",
#endif
if (dest_backup)
{
if (rename (dest_backup, dest))
- error (0, errno, "cannot un-backup `%s'", dest);
+ error (0, errno, _("cannot un-backup `%s'"), dest);
}
return 1;
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... SOURCE [DEST]\n\
or: %s [OPTION]... SOURCE... DIRECTORY\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Link SOURCE to DEST (. by default), or multiple SOURCE(s) to DIRECTORY.\n\
Makes hard links by default, symbolic links with -s.\n\
\n\
\n\
t, numbered make numbered backups\n\
nil, existing numbered if numbered backups exist, simple otherwise\n\
- never, simple always make simple backups\n");
+ never, simple always make simple backups\n"));
}
exit (status);
}
#ifdef S_ISLNK
symbolic_link = 1;
#else
- error (1, 0, "symbolic links are not supported on this system");
+ error (1, 0, _("symbolic links are not supported on this system"));
#endif
break;
case 'v':
if (optind == argc)
{
- error (0, 0, "missing file argument");
+ error (0, 0, _("missing file argument"));
usage (1);
}
to = argv[argc - 1];
if (!isdir (to))
- error (1, 0, "when making multiple links, last argument must be a directory");
+ error (1, 0, _("when making multiple links, last argument must be a directory"));
for (; optind < argc - 1; ++optind)
errors += do_link (argv[optind], to);
}
if (tabsize < 1)
{
error (0, 0,
- "ignoring invalid tab size in enironment variable TABSIZE: %s",
+ _("ignoring invalid tab size in enironment variable TABSIZE: %s"),
optarg);
tabsize = 8;
}
i = argmatch (optarg, color_args);
if (i < 0)
{
- invalid_arg ("colorization criterion", optarg, i);
+ invalid_arg (_("colorization criterion"), optarg, i);
usage (1);
}
i = color_types[i];
case 'w':
line_length = atoi (optarg);
if (line_length < 1)
- error (1, 0, "invalid line width: %s", optarg);
+ error (1, 0, _("invalid line width: %s"), optarg);
break;
case 'x':
case 'T':
tabsize = atoi (optarg);
if (tabsize < 1)
- error (1, 0, "invalid tab size: %s", optarg);
+ error (1, 0, _("invalid tab size: %s"), optarg);
break;
case 'U':
i = argmatch (optarg, sort_args);
if (i < 0)
{
- invalid_arg ("sort type", optarg, i);
+ invalid_arg (_("sort type"), optarg, i);
usage (1);
}
sort_type = sort_types[i];
i = argmatch (optarg, time_args);
if (i < 0)
{
- invalid_arg ("time type", optarg, i);
+ invalid_arg (_("time type"), optarg, i);
usage (1);
}
time_type = time_types[i];
i = argmatch (optarg, format_args);
if (i < 0)
{
- invalid_arg ("format type", optarg, i);
+ invalid_arg (_("format type"), optarg, i);
usage (1);
}
format = formats[i];
if (state < 0)
{
- error (0, 0, "bad %s variable\n", whichvar);
+ error (0, 0, _("bad %s variable\n"), whichvar);
print_with_color = 0;
}
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
+ printf (_("\
List information about the FILEs (the current directory by default).\n\
Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
\n\
-f do not sort, enable -aU, disable -lst\n\
--format=WORD across -x, commas -m, horizontal -x, long -l,\n\
single-column -1, verbose -l, vertical -C\n\
- --full-time list both full date and full time\n");
+ --full-time list both full date and full time\n"));
- printf ("\
+ printf (_("\
-G, --no-group inhibit display of group information\n\
-g (ignored)\n\
-I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n\
-q, --hide-control-chars print ? instead of non graphic characters\n\
-R, --recursive list subdirectories recursively\n\
-r, --reverse reverse order while sorting\n\
- -S sort by file size\n");
+ -S sort by file size\n"));
- printf ("\
+ printf (_("\
-s, --size print block size of each file\n\
--sort=WORD ctime -c, extension -X, none -U, size -S,\n\
status -c, time -t\n\
-7, --7bit allow only 7-bit ASCII characters to be printed\n\
-8, --8bit allow 8-bit ISO 8859 characters to be printed\n\
--help display this help and exit\n\
- --version output version information and exit");
+ --version output version information and exit"));
}
exit (status);
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION] DIRECTORY...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION] DIRECTORY...\n"), program_name);
+ printf (_("\
Create the DIRECTORY(ies), if they do not already exist.\n\
\n\
-p, --parents no error if existing, make parent directories as needed\n\
-m, --mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
if (optind == argc)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
{
struct mode_change *change = mode_compile (symbolic_mode, 0);
if (change == MODE_INVALID)
- error (1, 0, "invalid mode `%s'", symbolic_mode);
+ error (1, 0, _("invalid mode `%s'"), symbolic_mode);
else if (change == MODE_MEMORY_EXHAUSTED)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
newmode = mode_adjust (newmode, change);
}
}
else if (mkdir (argv[optind], newmode))
{
- error (0, errno, "cannot make directory `%s'", argv[optind]);
+ error (0, errno, _("cannot make directory `%s'"), argv[optind]);
errors = 1;
}
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION] NAME...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION] NAME...\n"), program_name);
+ printf (_("\
Create named pipes (FIFOs) with the given NAMEs.\n\
\n\
-m, --mode=MODE set permission mode (as in chmod), not 0666 - umask\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
symbolic_mode = NULL;
#ifndef S_ISFIFO
- error (4, 0, "fifo files not supported");
+ error (4, 0, _("fifo files not supported"));
#else
while ((optc = getopt_long (argc, argv, "m:", longopts, (int *) 0)) != EOF)
{
if (optind == argc)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
{
change = mode_compile (symbolic_mode, 0);
if (change == MODE_INVALID)
- error (1, 0, "invalid mode");
+ error (1, 0, _("invalid mode"));
else if (change == MODE_MEMORY_EXHAUSTED)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
newmode = mode_adjust (newmode, change);
}
{
if (mkfifo (argv[optind], newmode))
{
- error (0, errno, "cannot make fifo `%s'", argv[optind]);
+ error (0, errno, _("cannot make fifo `%s'"), argv[optind]);
errors = 1;
}
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... NAME TYPE [MAJOR MINOR]\n"), program_name);
+ printf (_("\
Create the special file NAME of the given TYPE.\n\
\n\
-m, --mode=MODE set permission mode (as in chmod), not 0666 - umask\n\
\n\
b create a block (buffered) special file\n\
c, u create a character (unbuffered) special file \n\
- p create a FIFO\n");
+ p create a FIFO\n"));
}
exit (status);
}
{
change = mode_compile (symbolic_mode, 0);
if (change == MODE_INVALID)
- error (1, 0, "invalid mode");
+ error (1, 0, _("invalid mode"));
else if (change == MODE_MEMORY_EXHAUSTED)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
newmode = mode_adjust (newmode, change);
}
{
const char *msg;
if (argc - optind < 2)
- msg = "too few arguments";
+ msg = _("too few arguments");
else if (argc - optind > 4)
- msg = "too many arguments";
+ msg = _("too many arguments");
else
- msg = "wrong number of arguments";
+ msg = _("wrong number of arguments");
error (0, 0, msg);
usage (1);
}
{
case 'b': /* `block' or `buffered' */
#ifndef S_IFBLK
- error (4, 0, "block special files not supported");
+ error (4, 0, _("block special files not supported"));
#else
if (argc - optind != 4)
{
- error (0, 0, "\
+ error (0, 0, _("\
when creating block special files, major and minor device\n\
-numbers must be specified");
+numbers must be specified"));
usage (1);
}
s = argv[optind + 2];
if (xstrtol (s, NULL, 0, &tmp_major, NULL) != LONGINT_OK)
- error (1, 0, "invalid major device number `%s'", s);
+ error (1, 0, _("invalid major device number `%s'"), s);
s = argv[optind + 3];
if (xstrtol (s, NULL, 0, &tmp_minor, NULL) != LONGINT_OK)
- error (1, 0, "invalid minor device number `%s'", s);
+ error (1, 0, _("invalid minor device number `%s'"), s);
i_major = (int) tmp_major;
i_minor = (int) tmp_minor;
case 'c': /* `character' */
case 'u': /* `unbuffered' */
#ifndef S_IFCHR
- error (4, 0, "character special files not supported");
+ error (4, 0, _("character special files not supported"));
#else
if (argc - optind != 4)
{
- error (0, 0, "\
+ error (0, 0, _("\
when creating character special files, major and minor device\n\
-numbers must be specified");
+numbers must be specified"));
usage (1);
}
s = argv[optind + 2];
if (xstrtol (s, NULL, 0, &tmp_major, NULL) != LONGINT_OK)
- error (1, 0, "invalid major device number `%s'", s);
+ error (1, 0, _("invalid major device number `%s'"), s);
s = argv[optind + 3];
if (xstrtol (s, NULL, 0, &tmp_minor, NULL) != LONGINT_OK)
- error (1, 0, "invalid minor device number `%s'", s);
+ error (1, 0, _("invalid minor device number `%s'"), s);
i_major = (int) tmp_major;
i_minor = (int) tmp_minor;
case 'p': /* `pipe' */
#ifndef S_ISFIFO
- error (4, 0, "fifo files not supported");
+ error (4, 0, _("fifo files not supported"));
#else
if (argc - optind != 2)
{
- error (0, 0, "\
-major and minor device numbers may not be specified for fifo files");
+ error (0, 0, _("\
+major and minor device numbers may not be specified for fifo files"));
usage (1);
}
if (mkfifo (argv[optind], newmode))
if (!S_ISREG (source_stats.st_mode))
{
- error (0, 0, "cannot move `%s' across filesystems: Not a regular file",
+ error (0, 0, _("cannot move `%s' across filesystems: Not a regular file"),
source);
return 1;
}
if (unlink (dest) && errno != ENOENT)
{
- error (0, errno, "cannot remove `%s'", dest);
+ error (0, errno, _("cannot remove `%s'"), dest);
return 1;
}
if (source_stats.st_dev == dest_stats.st_dev
&& source_stats.st_ino == dest_stats.st_ino)
{
- error (0, 0, "`%s' and `%s' are the same file", source, dest);
+ error (0, 0, _("`%s' and `%s' are the same file"), source, dest);
return 1;
}
if (S_ISDIR (dest_stats.st_mode))
{
- error (0, 0, "%s: cannot overwrite directory", dest);
+ error (0, 0, _("%s: cannot overwrite directory"), dest);
return 1;
}
if (!override_mode && (interactive || stdin_tty)
&& euidaccess (dest, W_OK))
{
- fprintf (stderr, "%s: replace `%s', overriding mode %04o? ",
+ fprintf (stderr, _("%s: replace `%s', overriding mode %04o? "),
program_name, dest,
(unsigned int) (dest_stats.st_mode & 07777));
if (!yesno ())
}
else if (interactive)
{
- fprintf (stderr, "%s: replace `%s'? ", program_name, dest);
+ fprintf (stderr, _("%s: replace `%s'? "), program_name, dest);
if (!yesno ())
return 0;
}
{
char *tmp_backup = find_backup_file_name (dest);
if (tmp_backup == NULL)
- error (1, 0, "virtual memory exhausted");
+ error (1, 0, _("virtual memory exhausted"));
dest_backup = (char *) alloca (strlen (tmp_backup) + 1);
strcpy (dest_backup, tmp_backup);
free (tmp_backup);
{
if (errno != ENOENT)
{
- error (0, errno, "cannot backup `%s'", dest);
+ error (0, errno, _("cannot backup `%s'"), dest);
return 1;
}
else
if (errno != EXDEV)
{
- error (0, errno, "cannot move `%s' to `%s'", source, dest);
+ error (0, errno, _("cannot move `%s' to `%s'"), source, dest);
goto un_backup;
}
if (unlink (source))
{
- error (0, errno, "cannot remove `%s'", source);
+ error (0, errno, _("cannot remove `%s'"), source);
return 1;
}
if (dest_backup)
{
if (rename (dest_backup, dest))
- error (0, errno, "cannot un-backup `%s'", dest);
+ error (0, errno, _("cannot un-backup `%s'"), dest);
}
return 1;
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("\
+ printf (_("\
Usage: %s [OPTION]... SOURCE DEST\n\
or: %s [OPTION]... SOURCE... DIRECTORY\n\
-",
+"),
program_name, program_name);
- printf ("\
+ printf (_("\
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\
\n\
-b, --backup make backup before removal\n\
\n\
t, numbered make numbered backups\n\
nil, existing numbered if numbered backups exist, simple otherwise\n\
- never, simple always make simple backups \n");
+ never, simple always make simple backups \n"));
}
exit (status);
}
if (argc < optind + 2)
{
- error (0, 0, "missing file argument%s", argc == optind ? "s" : "");
+ error (0, 0, _("missing file argument%s"), argc == optind ? "s" : "");
usage (1);
}
if (argc > optind + 2 && !isdir (argv[argc - 1]))
error (1, 0,
- "when moving multiple files, last argument must be a directory");
+ _("when moving multiple files, last argument must be a directory"));
/* Move each arg but the last onto the last. */
for (; optind < argc - 1; ++optind)
exit (0);
else
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
}
if (base[0] == '.' && (base[1] == '\0'
|| (base[1] == '.' && base[2] == '\0')))
{
- error (0, 0, "cannot remove `.' or `..'");
+ error (0, 0, _("cannot remove `.' or `..'"));
return 1;
}
#endif
)
{
- fprintf (stderr, "%s: remove %s`%s', overriding mode %04o? ",
+ fprintf (stderr, _("%s: remove %s`%s', overriding mode %04o? "),
program_name,
- S_ISDIR (statp->st_mode) ? "directory " : "",
+ S_ISDIR (statp->st_mode) ? _("directory ") : "",
pathname,
(unsigned int) (statp->st_mode & 07777));
if (!yesno ())
}
else if (interactive)
{
- fprintf (stderr, "%s: remove %s`%s'? ", program_name,
- S_ISDIR (statp->st_mode) ? "directory " : "",
+ fprintf (stderr, _("%s: remove %s`%s'? "), program_name,
+ S_ISDIR (statp->st_mode) ? _("directory ") : "",
pathname);
if (!yesno ())
return 1;
if (!recursive)
{
- error (0, 0, "%s: is a directory", pathname);
+ error (0, 0, _("%s: is a directory"), pathname);
return 1;
}
&& euidaccess (pathname, W_OK))
{
fprintf (stderr,
- "%s: descend directory `%s', overriding mode %04o? ",
+ _("%s: descend directory `%s', overriding mode %04o? "),
program_name, pathname,
(unsigned int) (statp->st_mode & 07777));
if (!yesno ())
}
else if (interactive)
{
- fprintf (stderr, "%s: descend directory `%s'? ",
+ fprintf (stderr, _("%s: descend directory `%s'? "),
program_name, pathname);
if (!yesno ())
return 1;
if (interactive)
{
if (err)
- fprintf (stderr, "%s: remove directory `%s' (might be nonempty)? ",
+ fprintf (stderr, _("%s: remove directory `%s' (might be nonempty)? "),
program_name, pathname);
else
- fprintf (stderr, "%s: remove directory `%s'? ",
+ fprintf (stderr, _("%s: remove directory `%s'? "),
program_name, pathname);
if (!yesno ())
return 1;
{
if (p->inum == inum)
{
- fprintf (stderr, "\
+ fprintf (stderr, _("\
%s: WARNING: Circular directory structure.\n\
This almost certainly means that you have a corrupted file system.\n\
NOTIFY YOUR SYSTEM MANAGER.\n\
Cycle detected:\n\
%s\n\
-is the same file as\n", program_name, pathname);
+is the same file as\n"), program_name, pathname);
*p->pathp = '\0'; /* Truncate pathname. */
fprintf (stderr, "%s\n", pathname);
*p->pathp = '/'; /* Put it back. */
if (interactive)
{
- fprintf (stderr, "%s: continue? ", program_name);
+ fprintf (stderr, _("%s: continue? "), program_name);
if (!yesno ())
exit (1);
return 1;
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... FILE...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
+ printf (_("\
Remove (unlink) the FILE(s).\n\
\n\
-d, --directory unlink directory, even if non-empty (super-user only)\n\
-v, --verbose explain what is being done\n\
-r, -R, --recursive remove the contents of directories recursively\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... DIRECTORY...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... DIRECTORY...\n"), program_name);
+ printf (_("\
Remove the DIRECTORY(ies), if they are empty.\n\
\n\
-p, --parents remove explicit parent directories if being emptied\n\
--help display this help and exit\n\
- --version output version information and exit\n");
+ --version output version information and exit\n"));
}
exit (status);
}
if (optind == argc)
{
- error (0, 0, "too few arguments");
+ error (0, 0, _("too few arguments"));
usage (1);
}
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]\n"), program_name);
+ printf (_("\
Force changed blocks to disk, update the super block.\n\
\n\
--help display this help and exit\n\
--version output version information and exit\n\
-");
+"));
}
exit (status);
}
parse_long_options (argc, argv, "sync", version_string, usage);
if (argc != 1)
- error (0, 0, "ignoring all arguments");
+ error (0, 0, _("ignoring all arguments"));
sync ();
exit (0);
usage (int status)
{
if (status != 0)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
{
- printf ("Usage: %s [OPTION]... FILE...\n", program_name);
- printf ("\
+ printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
+ printf (_("\
Update the access and modification times of each FILE to the current time.\n\
\n\
-a change only the access time\n\
--time=WORD access -a, atime -a, mtime -m, modify -m, use -a\n\
--version output version information and exit\n\
\n\
-STAMP may be used without -t if none of -drt, nor --, are used.\n");
+STAMP may be used without -t if none of -drt, nor --, are used.\n"));
}
exit (status);
}
flexible_date++;
newtime = get_date (optarg, NULL);
if (newtime == (time_t) -1)
- error (1, 0, "invalid date format `%s'", optarg);
+ error (1, 0, _("invalid date format `%s'"), optarg);
date_set++;
break;
posix_date++;
newtime = posixtime (optarg);
if (newtime == (time_t) -1)
- error (1, 0, "invalid date format `%s'", optarg);
+ error (1, 0, _("invalid date format `%s'"), optarg);
date_set++;
break;
i = argmatch (optarg, time_args);
if (i < 0)
{
- invalid_arg ("time selector", optarg, i);
+ invalid_arg (_("time selector"), optarg, i);
usage (1);
}
change_times |= time_masks[i];
if ((use_ref && (posix_date || flexible_date))
|| (posix_date && flexible_date))
{
- error (0, 0, "cannot specify times from more than one source");
+ error (0, 0, _("cannot specify times from more than one source"));
usage (1);
}
if (optind == argc)
{
- error (0, 0, "file arguments missing");
+ error (0, 0, _("file arguments missing"));
usage (1);
}