File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ $(upline 5)"
169
169
# Below function is copied from - https://gist.github.com/jaytaylor/5a90c49e0976aadfe0726a847ce58736
170
170
# Credit to @jkishner for https://gist.github.com/jkishner/2fccb24640a27c2d7ac9
171
171
function url_encode() {
172
- echo " $@ " |
172
+ builtin echo " $@ " |
173
173
sed \
174
174
-e ' s/%/%25/g' \
175
175
-e ' s/ /%20/g' \
@@ -220,6 +220,10 @@ upload() {
220
220
echo -e " \n$( clearline) $( upline 1) $( clearline) $( upline 1) "
221
221
echo " $( clearline) Upload Completed "
222
222
echo " $( clearline) Download link - ${lightgreen} https://index.sauraj.eu.org/${url_folder} /${url_file}${normal} "
223
+
224
+ if [[ $KSAUOPT_QUIET == true ]]; then
225
+ builtin echo " https://index.sauraj.eu.org/${url_folder} /${url_file} "
226
+ fi
223
227
}
224
228
225
229
help () {
@@ -228,6 +232,7 @@ ${aqua}Usage : ksau [-r] [OPTION]... [FILE]...${normal}
228
232
229
233
${aqua} Options:${normal}
230
234
-r Add random string to the end of filename when uploading
235
+ -q Suppress all output, printing only the link after upload is finished
231
236
232
237
Note that all options must be passed ${Red} BEFORE${normal} other arguments.
233
238
@@ -296,12 +301,18 @@ version() {
296
301
}
297
302
298
303
KSAUOPT_ADD_RAND_STR=false
304
+ KSAUOPT_QUIET=false
299
305
300
- while getopts " r " opt; do
306
+ while getopts " rq " opt; do
301
307
case $opt in
302
308
r)
303
309
KSAUOPT_ADD_RAND_STR=true
304
310
;;
311
+ q)
312
+ KSAUOPT_QUIET=true
313
+ # Override all echo call.
314
+ echo () { true ; }
315
+ ;;
305
316
? )
306
317
# Getopts already print error for us so just exit
307
318
exit 1
You can’t perform that action at this time.
0 commit comments