unjs / citty

🌆 Elegant CLI Builder
Other
735 stars 23 forks source link

Disabling Glob Pattern Parsing #108

Closed woodbrettm closed 8 months ago

woodbrettm commented 8 months ago

Describe the feature

Hi there! Just in the process of using Citty to build a cli and I'm really liking it so far.

I've hit a bit of a snag though regarding glob patterns in string arguments.

Is there a way to disable glob pattern parsing of arguments? I'm noticing for string args, if I pass in a glob pattern, the args and rawArgs passed into the run function are processed into file paths. I need to disable this as I'm processing the glob patterns separately.

Thanks! Brett

Additional information

pi0 commented 8 months ago

Hi dear @woodbrettm. Would you be able to make a reproduction? I suspect it is your Shell that handles glob not citty we don't implement any logic for that. Basically if in your shell you write echo * it will call echo executable with list of files in a string rather than *. You might try to escape like cli "*"

woodbrettm commented 8 months ago

Oh interesting, didn't realize that. I'm just running the cli as a local npm script from bash. Looks to be the case. Once I wrap the glob pattern in quotes it works. Thanks for the help!