diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2014-04-17 08:42:24 +0100 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2014-04-18 20:31:43 +0100 |
commit | eab4de10233923598f2b27cb0b868c723179b971 (patch) | |
tree | c63d9b56c71e7b2d7c49717e48b3f5afaf008819 | |
parent | ee19f369476c6b24892bcb9b50f9041d65d570ac (diff) | |
download | gvfs-eab4de10233923598f2b27cb0b868c723179b971.tar.gz |
gvfs-move: Improve the interactive overwrite
Mimic the output of mv by displaying the full URI and put a space
between the output and the user's input. Accept either lower or
upper-case 'y'.
https://bugzilla.gnome.org/show_bug.cgi?id=637543
-rw-r--r-- | programs/gvfs-move.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/programs/gvfs-move.c b/programs/gvfs-move.c index 22978748..057f982f 100644 --- a/programs/gvfs-move.c +++ b/programs/gvfs-move.c @@ -113,6 +113,7 @@ main (int argc, char *argv[]) GFile *source, *dest, *target; gboolean dest_is_dir; char *basename; + char *uri; int i; GFileCopyFlags flags; int retval = 0; @@ -208,12 +209,12 @@ main (int argc, char *argv[]) g_error_free (error); error = NULL; - basename = g_file_get_basename (target); - g_print ("overwrite %s?", basename); - g_free (basename); + uri = g_file_get_uri (target); + g_print (_("%s: overwrite ā%sā? "), argv[0], uri); + g_free (uri); if (fgets(line, sizeof (line), stdin) && - line[0] == 'y') + (line[0] == 'y' || line[0] == 'Y')) { flags |= G_FILE_COPY_OVERWRITE; if (!g_file_move (source, target, flags, NULL, NULL, NULL, &error)) |