AngelMunoz / Perla

A cross-platform tool for unbundled front-end development that doesn't depend on Node or requires you to install a complex toolchain
https://perla-docs.web.app/
MIT License
132 stars 11 forks source link

Make package a default argument for add verb #84

Closed nojaf closed 2 years ago

nojaf commented 2 years ago

Did you find any pain points?. When I used Perla and I added a new package it was a bit less intuitive to use the -p flag.

Example:

dotnet perla add uuid                                                                                                                                                                                                                                                                                    ❮   1 
ERROR: unrecognized argument: 'uuid'.
USAGE: dotnet.exe add [--help] [--package <string>] [--alias [<string>]] [--source [<skypack|jspm|jsdelivr|unpkg>]]

OPTIONS:

    --package, -p <string>
                          The name of the package to show information about.
    --alias, -a [<string>]
                          Specifier for this particular module.
    --source, -s [<skypack|jspm|jsdelivr|unpkg>]
                          The name of the source you want to install a package from. e.g. unpkg or skypack.
    --help                display this list of options.

I don't think this command works without the contents of -p so maybe we can make that a default argument.

AngelMunoz commented 2 years ago

This is one I wanted to have from the beginning but my lack of knowledge of argu made it the way it is right now

I'm thinking also that we could leverage fsharp.systemcommandline for the CLI app, @JordanMarrhelped me the last time to port anotherof my CLI's to that I can take that as the base to also move Perla

nojaf commented 2 years ago

In Argu you can use the [<MainCommand>] for this. I would honestly not migrate from Argu to any alternative in this situation. Save yourself a lot of work that is not worth it. fsharp.systemcommandline is probably new and shiny but I can't imagine it being a lifechanger over what you have right now.

I can send a PR to update the attribute if you like.

AngelMunoz commented 2 years ago

ah! That works as well, feel free to send it

AngelMunoz commented 2 years ago

This is out in v0.24.0