details
This commit is contained in:
@@ -9,6 +9,7 @@ _help() {
|
||||
(l)ist [default] List names of files
|
||||
(w)rite Save to share, read from stdin/file/folder
|
||||
(d)elete Delete an entry
|
||||
show Show details on file
|
||||
upload Get URL for uploads [no arguments]
|
||||
autocomplete Get Bash autocompletion script
|
||||
update Update self
|
||||
@@ -127,9 +128,6 @@ _write_stdin() { # name
|
||||
-H "Secret: $MFL_TOKEN" \
|
||||
"$MFL_ROOTURL"/upload
|
||||
}
|
||||
#~ _link_format() {
|
||||
#~ sed -e 's/^http:/https:/' -e 'p;' | sed -e "2s|$MFL_ROOTURL|&/dl|"
|
||||
#~ }
|
||||
|
||||
_delete() { # name
|
||||
read -p "Sure to delete: $1 ? Break to exit " foo
|
||||
@@ -137,18 +135,12 @@ _delete() { # name
|
||||
-H "Secret: $MFL_TOKEN" \
|
||||
"$MFL_ROOTURL"/delete/"$1"
|
||||
}
|
||||
_details() { # name
|
||||
curl -fL -w "\n" \
|
||||
-H "Secret: $MFL_TOKEN" \
|
||||
"$MFL_ROOTURL"/details/"$1"
|
||||
}
|
||||
|
||||
#~ _upload_url() {
|
||||
#~ echo "This information is a security risk, watch where it's shared"
|
||||
#~ echo "curl -fL -w \"\\n\" -H \"Max-Days: $MAXDAYS\" -u \"${USER}:${PASSWORD}\" $MFL_ROOTURL/[FILENAME] --upload-file [FILENAME]"
|
||||
#~ exit
|
||||
#~ }
|
||||
|
||||
#~ _self_url() {
|
||||
#~ echo "This information is a security risk, watch where it's shared"
|
||||
#~ echo "curl -L -H \"Token: $PASSWORD\" \"${MFL_ROOTURL}/xfer.sh\""
|
||||
#~ exit
|
||||
#~ }
|
||||
|
||||
_msg() {
|
||||
echo "$@" >&2
|
||||
@@ -216,6 +208,7 @@ fi
|
||||
[[ "$1" = "w" || "$1" = "write" ]] && { CMD=write; ARG1=$CMD; }
|
||||
[[ "$1" = "d" || "$1" = "delete" || "$1" = "del" ]] && { CMD=delete; ARG1=$CMD; }
|
||||
[[ "$1" = "l" || "$1" = "list" ]] && { CMD=list; ARG1=$CMD; }
|
||||
[[ "$1" = "show" ]] && { CMD=details; ARG1=$CMD; }
|
||||
[[ "$1" = "simplelist" ]] && { CMD=simple_list; ARG1=$CMD; }
|
||||
[[ "$1" = "autocomplete" ]] && { _get_completer; }
|
||||
[[ "$1" = "update" ]] && { _update_client; }
|
||||
@@ -253,3 +246,8 @@ fi
|
||||
_write
|
||||
exit $?
|
||||
}
|
||||
[[ "$CMD" = details ]] && {
|
||||
_details "$NAME"
|
||||
exit $?
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user