dutchcoders / transfer.sh

Easy and fast file sharing from the command-line.
https://github.com/dutchcoders/transfer.sh
MIT License
15.25k stars 1.54k forks source link

Short form curl command could be used in the example #588

Closed ozwaldorf closed 7 months ago

ozwaldorf commented 10 months ago

In the example on the site, a shorter form for --upload-file can be used instead, -T, which additionally will amend the URL with the document name. It's much simpler to type and easier to use

# Upload using cURL
$ curl -T ./hello.txt https://transfer.sh
https://transfer.sh/adjUT2e2EM/hello.txt

This also works for piping output, although you must specify the document name. Perhaps the service could support a default name for this flow:

# Upload command output
$ echo "hello world" | curl -T- https://transfer.sh/output
...
amayer5125 commented 10 months ago

While I agree that the filename being part of a flag and the URL may be redundant, I think using the long form of the flag in examples makes more sense. It is easier to read for people that are not familiar with a command. I've also found that using the long form of flags in scripts helps with readability when I come back to modify scripts months later.

aspacca commented 7 months ago

thanks @ozwaldorf for the information.

I will close the issue since its content is available anyway. If you want to share the information in the docs, please open a PR, thanks :)