yo icon indicating copy to clipboard operation
yo copied to clipboard

Generator name formatting when running `yo` when the name contains a `-`

Open tdashworth opened this issue 4 years ago • 3 comments

When running yo to discover which generators I have installed, the name of a generator is incorrectly formatted when it contains a -. For example, say I have installed the generator generator-sample-project, when running yo the output is:

> yo
? 'Allo Tom! What would you like to do? (Use arrow keys)
  Run a generator
> sample Project
  ──────────────
  Update your generators
  Install a generator
  Find some help
  Clear global config
(Move up and down to reveal more choices)

Instead of this I would expect either

  1. sample-project
  2. sample project
  3. Sample project
  4. Sample Project

But not sample Project.


I am running version 4.0.0 at Windows 10.

tdashworth avatar Apr 29 '21 08:04 tdashworth

Agreed, this should be improved. I think this issue is actually a subset and duplicate of #50. 👍

In theory yo could add some heuristics to figure out a name. But there will always be edge cases that break those heuristics. If someone wants a good name, they should specify in the config.

Someone please yell at me if I'm wrong about that assumption and you want to advocate for leaving this issue open separately. Cheers! 🎩

JoshuaKGoldberg avatar Jan 23 '25 20:01 JoshuaKGoldberg

Actually, before I close, @UlisesGascon - WDYT?

JoshuaKGoldberg avatar Jan 23 '25 22:01 JoshuaKGoldberg

Agree... we can improve the default formatting to match option 3 or 4 🤔

UlisesGascon avatar Jan 24 '25 10:01 UlisesGascon