aboutsummaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-20 10:56:08 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-20 11:17:35 -0400
commitb0225575c77ae73ffd74b4ffecd4c35846f91e7a (patch)
treee6d04e6d7f996cabd5109ea27319d4b3669f895b /CmdLine
parentc1ad287fa179f593cd91d6e1af3b53d34e9008cd (diff)
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.
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/GitAnnex/Options.hs2
1 files changed, 0 insertions, 2 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index 06b153295..b9c0fe7b7 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -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