diff --git a/cli-setup.cabal b/cli-setup.cabal
--- a/cli-setup.cabal
+++ b/cli-setup.cabal
@@ -1,5 +1,5 @@
 name:                cli-setup
-version:             0.1.0.3
+version:             0.2.0.0
 synopsis:            Helper setup scripts for packaging command-line tools.
 description:         Provides functions to set up manpages and shell completions. Intended to be used in the @Setup.hs@ module.
 homepage:            https://github.com/vmchale/cli-setup#readme
@@ -13,6 +13,7 @@
 extra-doc-files:     README.md
 extra-source-files:  stack.yaml
                    , cabal.project.local
+                   , py/optparse-applicative.py
 cabal-version:       >=1.18
 
 Flag development {
@@ -28,6 +29,7 @@
                      , directory
                      , process >= 1.4.0.0
                      , bytestring
+                     , file-embed
   default-language:    Haskell2010
   if flag(development)
     ghc-options:       -Werror
diff --git a/py/optparse-applicative.py b/py/optparse-applicative.py
new file mode 100644
--- /dev/null
+++ b/py/optparse-applicative.py
@@ -0,0 +1,15 @@
+import re
+from thefuck.utils import replace_argument
+
+def match(command):
+    return ('Did you mean this?' in command.output and 'Invalid argument' in command.output)
+
+def get_new_command(command):
+    broken = command.script_parts[1]
+    fix = re.findall(r'    ([a-zA-z]*)', command.output)[0]
+
+    return replace_argument(command.script, broken, fix)
+
+enabled_by_default = True
+
+priority = 100
diff --git a/src/Distribution/CommandLine.hs b/src/Distribution/CommandLine.hs
--- a/src/Distribution/CommandLine.hs
+++ b/src/Distribution/CommandLine.hs
@@ -1,13 +1,34 @@
+{-# LANGUAGE TemplateHaskell #-}
+
 module Distribution.CommandLine
     ( writeManpages
     , writeBashCompletions
     , setManpath
+    , writeTheFuck
     ) where
 
+import           Data.Bool          (bool)
 import           Control.Monad      (unless, void)
-import           System.Directory   (createDirectoryIfMissing)
+import           System.Directory   (createDirectoryIfMissing, doesDirectoryExist)
 import           System.Environment (lookupEnv)
 import           System.Process     (readCreateProcessWithExitCode, shell)
+import           Data.FileEmbed     (embedStringFile)
+
+rules :: String
+rules = $(embedStringFile "py/optparse-applicative.py")
+
+-- | Write a set of rules based on
+-- [optparse-applicative](http://hackage.haskell.org/package/optparse-applicative)
+-- for the command-line tool
+-- [fuck](https://pypi.python.org/pypi/thefuck/).
+writeTheFuck :: IO ()
+writeTheFuck = do
+    h <- lookupEnv "HOME"
+    case h of
+        Just h' -> do
+            proceed <- doesDirectoryExist (h' ++ "/.config/thefuck/rules")
+            bool (pure ()) (writeFile rules (h' ++ "/.config/thefuck/rules/optparse-applicative.py")) proceed
+        Nothing -> pure ()
 
 -- | Add a line exporting the modified @MANPATH@ to the user's @bashrc@, if it
 -- does not exist already.
