Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions src/CliMonad.elm
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,13 @@ withFormat basicType maybeFormatName getter default =
Just formatName ->
CliMonad
(\{ formats } ->
let
basicTypeName : String
basicTypeName =
Common.basicTypeToString basicType
in
case
FastDict.get ( Common.basicTypeToString basicType, formatName ) formats
FastDict.get ( basicTypeName, formatName ) formats
of
Nothing ->
let
Expand Down Expand Up @@ -520,14 +525,34 @@ withFormat basicType maybeFormatName getter default =
emptyOutput

else
let
firstLine : String
firstLine =
"Don't know how to handle format \""
++ formatName
++ "\" for type "
++ Common.basicTypeToString basicType
++ ", treating as the corresponding basic type."

available : List String
available =
List.filterMap
(\( b, f ) ->
if b == basicTypeName then
Just f

else
Nothing
)
(FastDict.keys formats)

secondLine : String
secondLine =
" Available formats: " ++ String.join ", " available
in
{ emptyOutput
| warnings =
[ { message =
"Don't know how to handle format \""
++ formatName
++ "\" for type "
++ Common.basicTypeToString basicType
++ ", treating as the corresponding basic type."
[ { message = firstLine ++ "\n" ++ secondLine
, path = [ "format" ]
}
]
Expand Down