JPeer264 / node-semantic-git-commit-cli

A CLI for semantic git commits
https://www.npmjs.com/package/semantic-git-commit-cli
MIT License
147 stars 11 forks source link

Parameters #70

Closed anoblet closed 5 years ago

anoblet commented 5 years ago

Is there any way to pass scope and message as arguments?

JPeer264 commented 5 years ago

Do you mean something like this:

$ sgc -m my message -s someScope

This is currently not implemented. What exactly do you except if you enter this? Should this still trigger sgc or just commit with the correct formatting?

anoblet commented 5 years ago

In my ideal situation, yes that would be the syntax (sgc -s someScope -m myMessage) sgc would handle the formatting of the commit. Just a quick way to skip the UI. Love your work!

JPeer264 commented 5 years ago

That's actually a great idea. But, how would you then handle the types, such as Feat: or Fix:, also with an argument, such as -t | --type? If so, we would then need another key in the types array, e.g. argKey. (Maybe you have a better solution)

I think the best solution for the arguments overall is to still trigger the UI, but just skip all parts where the argument is not given.

As an example:

So let's say for sgc just a message, scope and a type is needed (based on the .rcsrc) and you type following sgc -s myScope, then the scope will be skipped in the UI, as it is already prefilled, but the type and the message will still get asked. And if you type sgc -s myScope -t feat -m myMessage, then it will skip everything. How about that?

Love your work!

Thanks a lot! I appreciate that 👍

anoblet commented 5 years ago

That sounds awesome! I mixed up scope and type before, I use type and message right now for my commits. Setting required arguments, and only prompting for missing arguments sounds like the perfect solution.

JPeer264 commented 5 years ago

@anoblet this will take some time as I have to implement another feature where I refactored a bit (cc: #69)

JPeer264 commented 5 years ago

@anoblet released in v3.2.0. Thanks for your patience.

anoblet commented 5 years ago

Thanks!