mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-01 06:46:33 -04:00
Do not auto-complete directories in shell completions (only entries)
This commit is contained in:
@@ -2,7 +2,7 @@ function MUTNEntryCompleter {
|
||||
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
|
||||
#$entryPath = (Resolve-Path '~/.local/share/libmutton').Path # UNIX testing
|
||||
$entryPath = (Resolve-Path '~/AppData/Local/libmutton/entries').Path
|
||||
$entryNames = If (Test-Path $entryPath) {(Get-ChildItem -Path $entryPath -Recurse).FullName.Substring($entryPath.Length) -replace '\\', '/' -replace ' ', '` '}
|
||||
$entryNames = If (Test-Path $entryPath) {(Get-ChildItem -Path $entryPath -Recurse -File).FullName.Substring($entryPath.Length) -replace '\\', '/' -replace ' ', '` '}
|
||||
$entryNames | Where-Object { $_ -like "$wordToComplete*" }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user