fix bash completion of filenames containing spaces
Work around https://github.com/pcapriotti/optparse-applicative/issues/146 by not using action "file" and instead passing -o bashdefault -o default to complete. This way, when optparse fails to complete a filename, bash will fall back to regular filename completion. Unfortunately, optparse-applicative does not provide a way to control the options passed to complete, so I had to modify its generated completion script. Note that for "git annex" command completion, git's completion script already used -o bashdefault -o default, so that works too.
This commit is contained in:
parent
36cf98a24f
commit
07c108e70e
2 changed files with 13 additions and 3 deletions
|
@ -89,8 +89,6 @@ gitAnnexGlobalOptions = commonGlobalOptions ++
|
|||
cmdParams :: CmdParamsDesc -> Parser CmdParams
|
||||
cmdParams paramdesc = many $ argument str
|
||||
( metavar paramdesc
|
||||
-- Let bash completion complete files
|
||||
<> action "file"
|
||||
)
|
||||
|
||||
parseAutoOption :: Parser Bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue