From 24172b6bb6b27fa37784bd8ac0d3ca4744d9cf45 Mon Sep 17 00:00:00 2001 From: Q Date: Sat, 19 Aug 2023 22:02:13 +0300 Subject: [PATCH] details --- code/templates/mfl | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/code/templates/mfl b/code/templates/mfl index 2563e38..fa084ef 100755 --- a/code/templates/mfl +++ b/code/templates/mfl @@ -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 $? +} +