diff --git a/extra/completion.bash b/extra/completion.bash index 49d8688..9d5ef04 100644 --- a/extra/completion.bash +++ b/extra/completion.bash @@ -4,10 +4,10 @@ _path_gen() { local mutn_path="$HOME/.local/share/libmutton" local glob_status=$(shopt -p globstar) [ -z "${glob_status##*u*}" ] && shopt -s globstar # if recursive globbing is disabled, enable it - local full_paths=("$mutn_path"/**/*.gpg) + local full_paths=("$mutn_path"/**/*) $glob_status # set recursive globbing to user default for scan_path in "${full_paths[@]}"; do - trimmed_paths+=("${scan_path:${#mutn_path}:-4}") + trimmed_paths+=("${scan_path#$mutn_path}") done if [ "${trimmed_paths[0]}" == '/**/*' ]; then trimmed_paths[0]=help; fi } && diff --git a/extra/completion.zsh b/extra/completion.zsh index a3a2b48..b43789e 100644 --- a/extra/completion.zsh +++ b/extra/completion.zsh @@ -1,10 +1,10 @@ #compdef mutn mutn_path="$HOME/.local/share/libmutton" -full_paths=("$mutn_path"/**/*.gpg) +full_paths=("$mutn_path"/**/*) trimmed_paths=() for scan_path in "${full_paths[@]}"; do - trimmed_paths+=("${${scan_path#$mutn_path}%????}") + trimmed_paths+=("${scan_path#$mutn_path}") done [[ -z $trimmed_paths ]] && trimmed_paths=(help) diff --git a/main.go b/main.go index 1a7cc6f..af6e133 100644 --- a/main.go +++ b/main.go @@ -20,7 +20,6 @@ func main() { } else if argsCount == 1 { // initial entry reader shortcut - // TODO Do not use file extensions for entries! This will allow doing this check more efficiently than otherwise possible. if strings.HasPrefix(args[0], "/") { targetLocation := offline.EntryRoot + offline.PathSeparator + args[0][1:] if isFile, _ := offline.TargetIsFile(targetLocation, true); isFile { diff --git a/src/cli/entryList.go b/src/cli/entryList.go index e7d04d5..3a82391 100644 --- a/src/cli/entryList.go +++ b/src/cli/entryList.go @@ -54,9 +54,8 @@ func printFileEntry(entry string, lastSlash int, charCounter int, colorAlternato } colorAlternator = -colorAlternator - // trim the containing directory and file extension from the entry to determine fileEntryName + // trim the containing directory from the entry to determine fileEntryName fileEntryName := entry[lastSlash:] - fileEntryName = fileEntryName[:len(fileEntryName)-4] if charCounter == 0 { // indent first line of entries for each directory header fmt.Print(strings.Repeat(" ", indent*2))