TanklesXL / glint

Gleam command-line argument parsing with flags and automated help text generation.
https://hex.pm/packages/glint
Apache License 2.0
50 stars 7 forks source link

Example program "caps" flag capitalizes the whole message and not just the name #33

Closed ghost closed 4 months ago

ghost commented 4 months ago

The caps flag description is "Capitalized the provided name", however the uppercase function is applied to msg, not name. This results in: HELLO, JOE! and not Hello, JOE!.

The correct code could be something like this:

let name = 
  case input.args {
    ...
  }
let name = case caps {
  True -> uppercase(name)
  False -> name
}

There appears to be a similar bug in the hello example.

TanklesXL commented 4 months ago

Thanks for pointing this out! This is a holdover from the first iteration of this, I'll be updating it to correctly describe that it capitalizes the whole message

TanklesXL commented 4 months ago

the description of the command is now fixed in main! thanks for the heads up on this

ghost commented 4 months ago

the description of the command is now fixed in main! thanks for the heads up on this

No problem! Happy to help! 😄