Skip to content

Commit

Permalink
Fix command notes being replaced by descriptions
Browse files Browse the repository at this point in the history
This was causing the description of "new" prefixed and unprefixed
commands to be printed at both the top and bottom of their help text.
  • Loading branch information
acairncross authored and phadej committed Oct 12, 2020
1 parent ac80113 commit 81fd8d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cabal-install/Distribution/Client/CmdLegacy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ newCmd origUi@CommandUI{..} action = [cmd defaultUi, cmd newUi, cmd origUi]
{ commandName = newMsg commandName
, commandUsage = newMsg . commandUsage
, commandDescription = (newMsg .) <$> commandDescription
, commandNotes = (newMsg .) <$> commandDescription
, commandNotes = (newMsg .) <$> commandNotes
}

defaultMsg = T.unpack . T.replace "v2-" "" . T.pack
defaultUi = origUi
{ commandName = defaultMsg commandName
, commandUsage = defaultMsg . commandUsage
, commandDescription = (defaultMsg .) <$> commandDescription
, commandNotes = (defaultMsg .) <$> commandDescription
, commandNotes = (defaultMsg .) <$> commandNotes
}

0 comments on commit 81fd8d9

Please sign in to comment.