pkgxdev / pkgx

run anything
https://pkgx.sh
Apache License 2.0
8.95k stars 1.36k forks source link

Recommendations for the pkgx command without parameters #990

Closed tonycody closed 3 weeks ago

tonycody commented 6 months ago

image By default, the pkgx command is executed without any arguments and without any prompts.

It is recommended that, as with most command line programs, help messages be given by default when the user has nothing to parameterize. For example: git

image

dosubot[bot] commented 6 months ago

It seems like you've got this under control, if you want help or have specific questions, let me know what I can do for you!

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a đź‘Ť if this is helpful and đź‘Ž if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
michaelessiet commented 5 months ago

Wanted to comment lol. This would be a nice addition. I'm not sure how to add it myself. @jhheider mind pointing me to the right direction?

jhheider commented 5 months ago

almost certainly a check to see if it is zero-length https://github.com/pkgxdev/pkgx/blob/c60ba3d55d8f655d50a2986afa83202906697d94/src/parse-args.ts#L73 is the place to put the logic; oddly there's a mode = help on line 28, but help seems to set the mode to content on line 106. possibly different modes.

quick solution might be if it is empty, treat it as containing only --help.

mxcl commented 3 weeks ago

pkgx by itself lists the active environment and used to say something if there is none. Certainly listing --help makes sense though even though it's convention, I don't consider it particularly important. Running a command without knowing what it does is—dare I say it—foolhardy.