summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2014-04-17 08:22:49 +0100
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-04-18 20:31:43 +0100
commitdec164fc8dc7f7395be6510cb9f600f42398fb42 (patch)
tree4a0a114287a14232cc6cc98943e5a45868842629 /programs
parentc12758233bbeef5728e1589d908106ac5d1f1417 (diff)
downloadgvfs-dec164fc8dc7f7395be6510cb9f600f42398fb42.tar.gz
gvfs-copy: Improve the interactive overwrite
Mimic the output of cp 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
Diffstat (limited to 'programs')
-rw-r--r--programs/gvfs-copy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/programs/gvfs-copy.c b/programs/gvfs-copy.c
index 14d569cc..07d079aa 100644
--- a/programs/gvfs-copy.c
+++ b/programs/gvfs-copy.c
@@ -117,6 +117,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;
@@ -217,12 +218,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_copy (source, target, flags, NULL, NULL, NULL, &error))