codeBelt / generate-template-files

A simple generator to create custom template files for any application
https://medium.com/@robertsavian/generate-template-files-with-ease-19b320615359
MIT License
209 stars 31 forks source link

Improve Command Line and add validation. v3.0 #44

Closed codeBelt closed 4 years ago

codeBelt commented 4 years ago

41

31

krambono commented 4 years ago

I found some "problems" that I had fixed in my previous closed pr.

codeBelt commented 4 years ago

@knona Thanks for the feedback.

I don't understand the following. It should display an error if the command line has the same string replacers in command line and not work.

  • If you define many times the same string replacer in command line, it doesn't work

The user should see this error:

Screenshot 2020-05-23 15 26 56
krambono commented 4 years ago

We talked about that with @ccheney. We could imagine that we take the last value defined of the string replacer. To me, both behavior are correct.

I readed your last commit. I saw you use the process.exit() function. Why don't you catch the errors with a try / catch ?

From what I know using the exit function is not recommended.

codeBelt commented 4 years ago

Ok, I changed the process.exit() to a try/catch. Thanks @knona for reviewing this.

codeBelt commented 4 years ago

We could imagine that we take the last value defined of the string replacer.

@knona to make things easier we should just error and have the user fix their mistake then trying to fix it for them.

krambono commented 4 years ago

We could imagine that we take the last value defined of the string replacer.

@knona to make things easier we should just error and have the user fix their mistake then trying to fix it for them.

I agree.