mirror of
https://github.com/status-im/nim-confutils.git
synced 2025-02-12 20:16:30 +00:00
Lies, lies & damn lies
This commit is contained in:
parent
41eda1ac5b
commit
17246f6f69
@ -260,9 +260,7 @@ proc completeCmdArg(T: type string, val: TaintedString): seq[string] =
|
||||
proc completeCmdArg*(T: type[InputFile|InputDir], val: TaintedString): seq[string] =
|
||||
let (dir, name, ext) = splitFile(val)
|
||||
let tail = name & ext
|
||||
# Expand the directory component for the directory walker routine, we still
|
||||
# gotta use the user-supplied `dir` as a prefix in order to let the shell
|
||||
# recognize the entry
|
||||
# Expand the directory component for the directory walker routine
|
||||
let dir_path = if dir == "": "." else: expandTilde(dir)
|
||||
# Dotfiles are hidden unless the user entered a dot as prefix
|
||||
let show_dotfiles = len(name) > 0 and name[0] == '.'
|
||||
@ -277,9 +275,9 @@ proc completeCmdArg*(T: type[InputFile|InputDir], val: TaintedString): seq[strin
|
||||
if path.startsWith(tail):
|
||||
if type(T) is InputDir:
|
||||
# Add a trailing slash so that completions can be chained
|
||||
result.add(dir / path & '/')
|
||||
result.add(dir_path / path & '/')
|
||||
else:
|
||||
result.add(dir / path)
|
||||
result.add(dir_path / path)
|
||||
|
||||
proc completeCmdArg*(T: type[OutFile|OutDir|OutPath], val: TaintedString): seq[string] =
|
||||
return @[]
|
||||
|
Loading…
x
Reference in New Issue
Block a user