oCommandCompletion
    :: Params
    -> Config
    -> Shell
    -> String
    -- ^ Command name.
    -> Word
    -> [String]
    -> IO ()
doCommandCompletion params config shell commandName index words =
    getCompletion params config commandName >>= \case
        Nothing ->
            defaultCompletion
        Just mkCompletionCommand ->
            executeCommandCompletion params mkCompletionCommand shell index
                words
  where
    -- TODO: Should this be the same default completion as shell does?
    defaultCompletion = pure ()

doCommandCompletion
    :: Params
    -> Config
    -> Shell
    -> String
    -- ^ Command name.
    -> Word
    -> [String]
    -> IO ()
doCommandCompletion params config shell commandName index words =
    getCompletion params config commandName >>= \case
        Nothing ->
            defaultCompletion
        Just mkCompletionCommand ->
            executeCommandCompletion params mkCompletionCommand shell index
                words
  where
    -- TODO: Should this be the same default completion as shell does?
    defaultCompletion = pure ()
doCommandCompletion params config shell commandName index words =
    getCompletion params config commandName >>= \case
        Nothing ->
            defaultCompletion
        Just mkCompletionCommand ->
            executeCommandCompletion params mkCompletionCommand shell index
                words
  where
    -- TODO: Should this be the same default completion as shell does?
    defaultCompletion = pure ()