summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-14 13:19:04 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-14 13:19:04 -0400
commitd8bc62fed9ae2e85235fde7a6cba5f522daf6014 (patch)
treee4060fe221ab3dcb6ab2223e031987df6bfb7dbe /Command
parente323354b4ca2a44baae8223b9dd47aaab234a56a (diff)
Improve bash completion, so it completes names of remotes and backends in appropriate places.
Not necessarily everywhere, but a lot of the most often used places. Re the use of .Internal, see https://github.com/pcapriotti/optparse-applicative/issues/155
Diffstat (limited to 'Command')
-rw-r--r--Command/Drop.hs1
-rw-r--r--Command/Fsck.hs1
-rw-r--r--Command/Sync.hs5
3 files changed, 6 insertions, 1 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index feb89b70e..b23f81758 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -46,6 +46,7 @@ parseDropFromOption :: Parser (DeferredParse Remote)
parseDropFromOption = parseRemoteOption $ strOption
( long "from" <> short 'f' <> metavar paramRemote
<> help "drop content from a remote"
+ <> completeRemotes
)
seek :: DropOptions -> CommandSeek
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index a522f5349..656ceb644 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -67,6 +67,7 @@ optParser desc = FsckOptions
<*> optional (parseRemoteOption $ strOption
( long "from" <> short 'f' <> metavar paramRemote
<> help "check remote"
+ <> completeRemotes
))
<*> optional parseincremental
<*> optional (parseKeyOptions False)
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 4e6bf11d7..19a984300 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -70,7 +70,10 @@ data SyncOptions = SyncOptions
optParser :: CmdParamsDesc -> Parser SyncOptions
optParser desc = SyncOptions
- <$> cmdParams desc
+ <$> (many $ argument str
+ ( metavar desc
+ <> completeRemotes
+ ))
<*> invertableSwitch "commit" True
( help "avoid git commit"
)