File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 88# Be sure to check readme doc at https://github.com/adhocore/bash-tus
99#
1010
11+ FULL=` readlink -f $0 ` # fullpath
12+ TUSC=` basename $0 ` # name
13+
1114# message helpers
1215line () { echo -e " \e[${3:- 0} ;$2 m$1 \e[0m" ; }
1316error () { line " $1 " 31; if [[ ! ${2:- 0} -eq 0 ]]; then exit $2 ; fi }
1417ok () { line " ${1:- Done} " 32; }
1518info () { line " $1 " 33; }
1619comment () { line " $1 " 30 1; }
20+
21+ # show version
22+ version () { echo v0.0.1; }
23+
24+ # show usage
25+ usage ()
26+ {
27+ cat << USAGE
28+ $TUSC $( info ` version` ) | $( ok " (c) Jitendra Adhikari" )
29+ $TUSC is bash implementation of tus-client (https://tus.io).
30+ $( ok Usage:)
31+ $TUSC <--options>
32+ $TUSC <host> <file> [algo]
33+ $( ok Options:)
34+ $( info " -a --algo" ) $( comment " The algorigthm for key &/or checksum." )
35+ $( comment " (Eg: sha1, sha256)" )
36+ $( info " -f --file" ) $( comment " The file to upload." )
37+ $( info " -h --help" ) $( comment " Show help information and usage." )
38+ $( info " -H --host" ) $( comment " The tus-server host where file is uploaded." )
39+ $( ok Examples:)
40+ $TUSC
41+ $TUSC version $( comment " # prints current version of itself" )
42+ $TUSC --help $( comment " # shows this help" )
43+ USAGE
44+ exit 0
45+ }
You can’t perform that action at this time.
0 commit comments