Skip to content

Commit e160ad9

Browse files
committed
docs: update help and usage, add preview
1 parent f01c605 commit e160ad9

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ curl -sSLo ~/tusc https://raw.githubusercontent.com/adhocore/tusc.sh/master/tusc
2323
chmod +x ~/tusc && sudo ln -s ~/tusc /usr/local/bin/tusc
2424
```
2525

26-
#### System Requirements
27-
- curl
28-
- dd
29-
- sha1sum/sha256sum
26+
### System Requirements
27+
- `curl`
28+
- `dd`
29+
- `sha1sum`/`sha256sum`
3030

31-
## Usage and Examples
3231

32+
## Usage and Examples
3333
```
34-
tusc v0.1.1 | (c) Jitendra Adhikari
34+
tusc v0.5.0 | (c) Jitendra Adhikari
3535
tusc is bash implementation of tus-client (https://tus.io).
3636
3737
Usage:
@@ -42,11 +42,14 @@ chmod +x ~/tusc && sudo ln -s ~/tusc /usr/local/bin/tusc
4242
-a --algo The algorigthm for key &/or checksum.
4343
(Eg: sha1, sha256)
4444
-b --base-path The tus-server base path (Default: '/files/').
45+
-C --no-color Donot color the output (Useful for parsing output).
4546
-f --file The file to upload.
4647
-h --help Show help information and usage.
4748
-H --host The tus-server host where file is uploaded.
4849
-L --locate Locate the uploaded file in tus-server.
50+
-S --no-spin Donot show the spinner (Useful for parsing output).
4951
-u --update Update tusc to latest version.
52+
--version Print the current tusc version.
5053
5154
Examples:
5255
tusc --help # shows this help
@@ -58,8 +61,18 @@ chmod +x ~/tusc && sudo ln -s ~/tusc /usr/local/bin/tusc
5861
tusc -H 0:1080 -f ww.mp4 -b /store/ # uploads ww.mp4 to http://0.0.0.0:1080/store/
5962
```
6063

61-
### Debugging
64+
If you want to parse the output of `tusc`, pass in `-C` (no color) and `-S` (no spin) flags. Eg:
65+
```sh
66+
# Locate the URL of a file and download it
67+
wget $(tusc -H 0:1080 -f ww.mp4 -L -S -C | cut -c 6-999) -O ww.mp4.1
68+
```
6269

70+
### Preview
71+
See `tusc` in action with debug mode where the upload is aborted frequently with `Ctrl+C` interrupt.
72+
73+
[![Screen Preview](https://imgur.com/SN4lE3o.gif "tusc in action")](https://github.com/adhocore/tusc.sh)
74+
75+
### Debugging
6376
To print the debugging information pass in `DEBUG=1` env like so:
6477
```sh
6578
DEBUG=1 tusc 0:1080 ww.mp4
@@ -75,8 +88,8 @@ To revert the above step, just remove the debug file:
7588
rm ~/.tus.dbg
7689
```
7790

78-
## Trying Out
7991

92+
## Trying Out
8093
To get hands on in local machine, you can install [tusd](https://github.com/tus/tusd#download-pre-builts-binaries-recommended) server.
8194

8295
Then,

0 commit comments

Comments
 (0)