etCompletion
    :: Params
    -> Config
    -> String
    -> IO (Maybe (Shell -> Natural -> [Text] -> Command))
getCompletion params Config{commands} commandName =
    case List.find (isNamed (fromString commandName)) commands of
        Nothing ->
            dieWith params stderr 1
                ("'" <> fromString commandName <> "': Missing argument.")

        Just NamedCommand{completion} ->
            pure completion

getCompletion
    :: Params
    -> Config
    -> String
    -> IO (Maybe (Shell -> Natural -> [Text] -> Command))
getCompletion params Config{commands} commandName =
    case List.find (isNamed (fromString commandName)) commands of
        Nothing ->
            dieWith params stderr 1
                ("'" <> fromString commandName <> "': Missing argument.")

        Just NamedCommand{completion} ->
            pure completion
getCompletion params Config{commands} commandName =
    case List.find (isNamed (fromString commandName)) commands of
        Nothing ->
            dieWith params stderr 1
                ("'" <> fromString commandName <> "': Missing argument.")

        Just NamedCommand{completion} ->
            pure completion