Skip to content

Commit

Permalink
Use hyphens for action usage output
Browse files Browse the repository at this point in the history
Currently action usage output looks like
`alr action [options] [post_fetch|pre_build|post_build|test]`
but it should look like
`alr action [options] [post-fetch|pre-build|post-build|test]`.

This commit fixes the problem by replacing underscores with hyphens.
  • Loading branch information
0rzech committed Nov 24, 2022
1 parent 2d8fab4 commit e97b1db
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/alr/alr-commands-action.adb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ package body Alr.Commands.Action is
-----------

function Build (Moment : Alire.Properties.Actions.Moments) return String
is ((if Moment /= Moments'First then "|" else "")
& AAA.Strings.To_Lower_Case (Moment'Image)
& (if Moment = Moments'Pred (On_Demand)
then ""
else Build (Moments'Succ (Moment))));
is
use AAA.Strings;
begin
return (if Moment /= Moments'First then "|" else "")
& To_Lower_Case (Replace (Moment'Image, "_", "-"))
& (if Moment = Moments'Pred (On_Demand)
then ""
else Build (Moments'Succ (Moment)));
end Build;

begin
return Build (Alire.Properties.Actions.Moments'First);
Expand Down

0 comments on commit e97b1db

Please sign in to comment.