sailorproject / sailor

A Lua MVC Web Framework.
MIT License
921 stars 125 forks source link

CLI refactor to use argparse #96

Closed xspager closed 7 years ago

xspager commented 8 years ago

This PR is the refactor and use of the argparse part of issue #69. Add argparse itself as dependency and also ansicolors to improve the readability and maintainability of the help messages.

One thing to note is that the test command now need "--" before the arguments passed to busted.

Etiene commented 8 years ago

Thanks for the awesome PR! :dancer: I need to review this in more details soon, specially because I didn't really understand why 4 hyphens here: https://github.com/sailorproject/sailor/pull/96/files#diff-354f30a63fb0907d4ad57269548329e3L51

xspager commented 8 years ago

It makes argparse ignore if flags are present after it ("--") so they can be passed as a positional argument (argparse doc talking about it), then everything after is concatenated and sent to busted https://github.com/sailorproject/sailor/pull/96/files#diff-d445172d2bfc1ce8b854bc3190272cdbR74

Take your time. I'll stop working in the issue #69 until this is merged.

Etiene commented 8 years ago

I was thinking maybe we should use cliargs instead of argparse now that busted is using cliargs 3 :x

xspager commented 8 years ago

I'll see what I can do, first I need to know if the limited support to commands on this last version of argparse will be enough. On May 28, 2016 5:28 PM, "Etiene Dalcol" notifications@github.com wrote:

I was thinking we should use cliargs instead of argparse now that busted is using cliargs 3 :x

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sailorproject/sailor/pull/96#issuecomment-222328213, or mute the thread https://github.com/notifications/unsubscribe/AAxAGDM5Hu7NiOYR-rvjjWVI-4Rusngdks5qGKVJgaJpZM4HnpII .

Etiene commented 7 years ago

Merged! I refactored a little bit so the main cli functions are now on a cli module and the cli is just the parse config :) Sorry it took so long! ^_^'