gofr icon indicating copy to clipboard operation
gofr copied to clipboard

Add `-h` or `--help` for `gofr.NewCMD()`

Open linux-china opened this issue 9 months ago • 7 comments

List sub commands if ./cli -h invoked.

linux-china avatar May 06 '24 06:05 linux-china

we can also print their functionality along with the subcommands when -h or --help is invoked. Need to have a way to add helper/description strings to the sub-commands.

vipul-rawat avatar May 06 '24 06:05 vipul-rawat

Quite interesting! I want to work on it.

IvanGael avatar May 07 '24 13:05 IvanGael

@IvanGael any updates on this? Please let us know if you are facing any issues :)

vipul-rawat avatar May 13 '24 06:05 vipul-rawat

@vipul-rawat In fact, I try to understand the general structure of the code and the project to know exactly where I need to integrate this feature. If you could tell me the files that are affected by this feature, that would help me a lot. THANKS!

IvanGael avatar May 13 '24 07:05 IvanGael

So for gofr applications, we have tried to generalise the request/response structure for our applications. So command line applications also fall under the same. So it is important to understand the Request and Responder interface. The files concerning the feature would pe pkg/gofr/gofr.com, pkg/gofr/cmd.go

vipul-rawat avatar May 13 '24 09:05 vipul-rawat

We would like to have a default command added to the cmd applications that would list out all the routes that are registered with the cmd applications, we can also print out them when an unknown sub-command is executed.

vipul-rawat avatar May 13 '24 09:05 vipul-rawat

Thank you for the clarification. I'll try to look into that and get back to you shortly if I have any further questions.

IvanGael avatar May 13 '24 11:05 IvanGael

Can I try to work on it as well?

KedarisettiSreeVamsi avatar May 16 '24 13:05 KedarisettiSreeVamsi

@KedarisettiSreeVamsi I'm already working on this issue so I think it would be wiser to work on another issue. I think currently another issues are open! @vipul-rawat what do you think about it ?

IvanGael avatar May 16 '24 16:05 IvanGael

@IvanGael any updates? Anywhere I could help you?

vipul-rawat avatar May 24 '24 06:05 vipul-rawat

@vipul-rawat and @aryanmehrotra Can I work on this issue?

KedarisettiSreeVamsi avatar May 27 '24 22:05 KedarisettiSreeVamsi

@vipul-rawat I just created a pull request. Try to review it.

IvanGael avatar May 28 '24 01:05 IvanGael

@vipul-rawat and @aryanmehrotra Can I work on this issue?

Hey @KedarisettiSreeVamsi IvanGael is already working on the same, you can provide feedbacks and suggestions on the work done in PR #661

vipul-rawat avatar May 28 '24 08:05 vipul-rawat

@vipul-rawat I just added new commit

IvanGael avatar May 28 '24 12:05 IvanGael

Hi @IvanGael, I have also made an implementation of helper command. Can we discuss once on my implementation if possible?

KedarisettiSreeVamsi avatar May 28 '24 17:05 KedarisettiSreeVamsi