pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

Recommendations for the pkgx command without parameters

Open tonycody opened this issue 1 year ago • 3 comments

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

tonycody avatar Mar 25 '24 09:03 tonycody

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.

dosubot[bot] avatar Mar 25 '24 09:03 dosubot[bot]

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?

michaelessiet avatar Apr 10 '24 17:04 michaelessiet

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.

jhheider avatar Apr 10 '24 17:04 jhheider

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.

mxcl avatar Sep 06 '24 15:09 mxcl