diff --git a/README.md b/README.md index 751caf44..1153cf0f 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,12 @@ go get github.com/schollz/croc To send a file, simply do: ``` -$ croc send FILE -Sending 'FILE' (X MB) +$ croc send file-or-folder +Sending 'file-or-folder' (X MB) Code is: code-phrase ``` -Them to receive the file on another computer, you can just do +Them to receive the file (or folder) on another computer, you can just do ``` $ croc code-phrase @@ -61,6 +61,7 @@ $ croc code-phrase The code phrase is used to establish password-authenticated key agreement ([PAKE](https://en.wikipedia.org/wiki/Password-authenticated_key_agreement)) which generates a secret key for the sender and recipient to use for end-to-end encryption. + ### Custom code phrase You can send with your own code phrase (must be more than 4 characters). @@ -78,10 +79,10 @@ You can pipe to `croc`: $ cat [filename] | croc send ``` -In this case `croc` will automatically use the stdin data and send and assign a filename like "croc-stdin-123456789". To receive to `stdout` at you can always just use the `--yes` and `--stdout` flags which will automatically approve the transfer and pipe it out to `stdout`. +In this case `croc` will automatically use the stdin data and send and assign a filename like "croc-stdin-123456789". To receive to `stdout` at you can always just use the `--yes` will automatically approve the transfer and pipe it out to `stdout`. ``` -$ croc --yes --stdout [code-phrase] > out +$ croc --yes [code-phrase] > out ``` All of the other text printed to the console is going to `stderr` so it will not interfere with the message going to `stdout`. diff --git a/src/croc/croc.go b/src/croc/croc.go index eba0a564..1622442e 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -746,7 +746,7 @@ func (c *Client) receiveData(i int) { if c.TotalChunksTransfered == len(c.CurrentFileChunks) || c.TotalSent == c.FilesToTransfer[c.FilesToTransferCurrentNum].Size { log.Debug("finished receiving!") c.CurrentFile.Close() - if c.Options.Stdout { + if c.Options.Stdout || strings.HasPrefix(c.FilesToTransfer[c.FilesToTransferCurrentNum].Name,"croc-stdin") { pathToFile := path.Join( c.FilesToTransfer[c.FilesToTransferCurrentNum].FolderRemote, c.FilesToTransfer[c.FilesToTransferCurrentNum].Name,