Skip to content

Commit

Permalink
quick fix for delete.type, #4315 for next steps
Browse files Browse the repository at this point in the history
  • Loading branch information
sixfourtwelve committed Sep 8, 2023
1 parent 3565bfa commit 5302538
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions unison-cli/src/Unison/CommandLine/InputPatterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,8 @@ renameType =
"`rename.type` takes two arguments, like `rename.type oldname newname`."
)

deleteGen :: Maybe String -> String -> ([Path.HQSplit'] -> DeleteTarget) -> InputPattern
deleteGen suffix target mkTarget =
deleteGen :: Maybe String -> ArgumentType -> String -> ([Path.HQSplit'] -> DeleteTarget) -> InputPattern
deleteGen suffix queryCompletionArg target mkTarget =
let cmd = maybe "delete" ("delete." <>) suffix
info =
P.wrapColumn2 [
Expand Down Expand Up @@ -711,7 +711,7 @@ deleteGen suffix target mkTarget =
cmd
[]
I.Visible
[(OnePlus, exactDefinitionTermQueryArg)]
[(OnePlus, queryCompletionArg)]
info
( \case
[] -> Left . P.warnCallout $ P.wrap warn
Expand All @@ -721,22 +721,22 @@ deleteGen suffix target mkTarget =
)

delete :: InputPattern
delete = deleteGen Nothing "term or type" (DeleteTarget'TermOrType DeleteOutput'NoDiff)
delete = deleteGen Nothing exactDefinitionTermQueryArg "term or type" (DeleteTarget'TermOrType DeleteOutput'NoDiff)

deleteVerbose :: InputPattern
deleteVerbose = deleteGen (Just "verbose") "term or type" (DeleteTarget'TermOrType DeleteOutput'Diff)
deleteVerbose = deleteGen (Just "verbose") exactDefinitionTermQueryArg "term or type" (DeleteTarget'TermOrType DeleteOutput'Diff)

deleteTerm :: InputPattern
deleteTerm = deleteGen (Just "term") "term" (DeleteTarget'Term DeleteOutput'NoDiff)
deleteTerm = deleteGen (Just "term") exactDefinitionTermQueryArg "term" (DeleteTarget'Term DeleteOutput'NoDiff)

deleteTermVerbose :: InputPattern
deleteTermVerbose = deleteGen (Just "term.verbose") "term" (DeleteTarget'Term DeleteOutput'Diff)
deleteTermVerbose = deleteGen (Just "term.verbose") exactDefinitionTermQueryArg "term" (DeleteTarget'Term DeleteOutput'Diff)

deleteType :: InputPattern
deleteType = deleteGen (Just "type") "type" (DeleteTarget'Type DeleteOutput'NoDiff)
deleteType = deleteGen (Just "type") exactDefinitionTypeQueryArg "type" (DeleteTarget'Type DeleteOutput'NoDiff)

deleteTypeVerbose :: InputPattern
deleteTypeVerbose = deleteGen (Just "type.verbose") "type" (DeleteTarget'Type DeleteOutput'Diff)
deleteTypeVerbose = deleteGen (Just "type.verbose") exactDefinitionTypeQueryArg "type" (DeleteTarget'Type DeleteOutput'Diff)

deleteTermReplacementCommand :: String
deleteTermReplacementCommand = "delete.term-replacement"
Expand Down

0 comments on commit 5302538

Please sign in to comment.