From 9092dc636925a6a8cef9a90172c597e1f58ba017 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 26 Oct 2017 21:37:16 +0300 Subject: [PATCH] update custom 'put' command section in doc --- doc.go | 17 +++++++++-------- docstring.go | 16 +++++++++------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc.go b/doc.go index cc62976..49ee409 100644 --- a/doc.go +++ b/doc.go @@ -346,18 +346,19 @@ implementation. The default behavior is similar to the following command: mode=$(echo "$load" | sed -n '1p') list=$(echo "$load" | sed '1d') if [ $mode = 'copy' ]; then - cp -r $list . + cp -R -n $list . elif [ $mode = 'move' ]; then - mv $list . + mv -n $list . fi + lf -remote "send $id renew" + lf -remote "$(printf 'save\nmove\n\n')" + lf -remote "send sync" }} -Some of the useful things you can do is to add some backup or overwrite options -to 'cp' and 'mv' operations (e.g. '--backup' or '-n'), change the command type -to asynchronous while also adding a remote 'renew' call at the end to update -the client afterwards, or use 'rsync' command with progress bar option for -copying and feed the progress to the client periodically with remote 'echo' -calls. +Some useful things are to use the backup option ('--backup') with 'cp' and 'mv' +commands if they support it (i.e. GNU implementation), change the command type +to asynchronous, or use 'rsync' command with progress bar option for copying +and feed the progress to the client periodically with remote 'echo' calls. By default, lf does not provide an actual file deletion command to protect new users. You can define such a command and optionally assign a key if you like. diff --git a/docstring.go b/docstring.go index e6c5eae..9007a1e 100644 --- a/docstring.go +++ b/docstring.go @@ -360,17 +360,19 @@ implementation. The default behavior is similar to the following command: mode=$(echo "$load" | sed -n '1p') list=$(echo "$load" | sed '1d') if [ $mode = 'copy' ]; then - cp -r $list . + cp -R -n $list . elif [ $mode = 'move' ]; then - mv $list . + mv -n $list . fi + lf -remote "send $id renew" + lf -remote "$(printf 'save\nmove\n\n')" + lf -remote "send sync" }} -Some of the useful things you can do is to add some backup or overwrite -options to 'cp' and 'mv' operations (e.g. '--backup' or '-n'), change the -command type to asynchronous while also adding a remote 'renew' call at the -end to update the client afterwards, or use 'rsync' command with progress -bar option for copying and feed the progress to the client periodically with +Some useful things are to use the backup option ('--backup') with 'cp' and +'mv' commands if they support it (i.e. GNU implementation), change the +command type to asynchronous, or use 'rsync' command with progress bar +option for copying and feed the progress to the client periodically with remote 'echo' calls. By default, lf does not provide an actual file deletion command to protect