1
1
mirror of https://github.com/jarun/nnn.git synced 2024-11-05 01:20:18 +03:00

Use short options

This commit is contained in:
Arun Prakash Jana 2021-03-21 19:33:43 +05:30
parent 73a54e7550
commit 2f6046e6da
No known key found for this signature in database
GPG Key ID: A75979F35C080412
4 changed files with 6 additions and 6 deletions

View File

@ -510,7 +510,7 @@ handle_blocked() {
esac esac
} }
MIMETYPE="$( file --dereference --brief --mime-type -- "${FPATH}" )" MIMETYPE="$( file -bL --mime-type -- "${FPATH}" )"
handle_extension handle_extension
handle_multimedia "${MIMETYPE}" handle_multimedia "${MIMETYPE}"
handle_mime "${MIMETYPE}" handle_mime "${MIMETYPE}"

View File

@ -138,7 +138,7 @@ previewer_loop () {
kill_viewer kill_viewer
MIME="$(file -b --mime-type "$FILE")" MIME="$(file -bL --mime-type "$FILE")"
case "$MIME" in case "$MIME" in
video/*) video/*)

View File

@ -137,8 +137,8 @@ preview_file () {
# Detecting the exact type of the file: the encoding, mime type, and # Detecting the exact type of the file: the encoding, mime type, and
# extension in lowercase. # extension in lowercase.
encoding="$(file -Lb --mime-encoding -- "$1")" encoding="$(file -bL --mime-encoding -- "$1")"
mimetype="$(file -Lb --mime-type -- "$1")" mimetype="$(file -bL --mime-type -- "$1")"
ext="${1##*.}" ext="${1##*.}"
if [ -n "$ext" ]; then if [ -n "$ext" ]; then
ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')" ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')"

View File

@ -148,8 +148,8 @@ preview_file () {
# Detecting the exact type of the file: the encoding, mime type, and # Detecting the exact type of the file: the encoding, mime type, and
# extension in lowercase. # extension in lowercase.
encoding="$(file -Lb --mime-encoding -- "$1")" encoding="$(file -bL --mime-encoding -- "$1")"
mimetype="$(file -Lb --mime-type -- "$1")" mimetype="$(file -bL --mime-type -- "$1")"
ext="${1##*.}" ext="${1##*.}"
if [ -n "$ext" ]; then if [ -n "$ext" ]; then
ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')" ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')"