gum
gum copied to clipboard
Can't get full name while there have a space between first name and last name
Can't get full name while there have a space between first name and last name. Example: Tom Hanks Got: Tom
@mayflower-zc Which version of gum? v1.0.4 has been supported
I have reproduced this issue.
environment
gum version: v1.0.4
operating system: macOS bigSur
procedure
gum set hello --name hello world --email [email protected]
gum list
result:
┌────────────┬─────────────────────┬────────────────────────┐
│ group-name │ name │ email │
├────────────┼─────────────────────┼────────────────────────┤
│ global │ 周宇盛 Yusheng Zhou │ [email protected] │
│ hello │ hello │ [email protected] │
└────────────┴─────────────────────┴────────────────────────┘
the global git config's name can have space, but the config in gum can't have space
solution
use quote
gum set hello --name 'hello world' --email [email protected]
gum list
┌────────────┬─────────────────────┬────────────────────────┐
│ group-name │ name │ email │
├────────────┼─────────────────────┼────────────────────────┤
│ global │ 周宇盛 Yusheng Zhou │ [email protected] │
│ hello │ hello world │ [email protected] │
└────────────┴─────────────────────┴────────────────────────┘
or gum
preprocess the argument list before pass them to commander.js
reason
the argument list get from process.argv
treat hello world
as seperate argument, and commander.js
can not recognize the argument world
.
source code:
- get command line argument in
gum
: https://github.com/gauseen/gum/blob/master/src/index.js#L40 - parse command line argument in
commander.js
: https://github.com/tj/commander.js/blob/master/lib/command.js#L1286