Support help.autocorrect settings "never" and "immediate"
This commit is contained in:
parent
b0ef04f0b7
commit
104ca5e09e
2 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
git-annex (10.20250116) UNRELEASED; urgency=medium
|
||||
|
||||
* Support help.autocorrect=prompt.
|
||||
* Support help.autocorrect settings "prompt", "never", and "immediate".
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 20 Jan 2025 10:24:51 -0400
|
||||
|
||||
|
|
|
@ -55,6 +55,8 @@ prepare cmdname input showmatch matches r =
|
|||
| otherwise -> sleep n
|
||||
Nothing -> case getcfg <$> r of
|
||||
Just "prompt" -> prompt
|
||||
Just "never" -> unknowncommand
|
||||
Just "immediate" -> warn Nothing
|
||||
_ -> list
|
||||
where
|
||||
getcfg = fromConfigValue . Git.Config.get "help.autocorrect" "0"
|
||||
|
@ -89,3 +91,5 @@ prepare cmdname input showmatch matches r =
|
|||
resp <- headMaybe . map toLower <$> getLine
|
||||
when (resp /= Just 'y') $
|
||||
exitWith (ExitFailure 1)
|
||||
|
||||
unknowncommand = giveup $ "Unknown command '" ++ input ++ "'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue