theimpossibleastronaut / modemu2k

modemu2k is a fork of modemu, a telnet client with a modem-like user interface
https://theimpossibleastronaut.com/modemu2k
GNU General Public License v3.0
10 stars 6 forks source link

a "--help" argument needs to be added #3

Closed andy5995 closed 6 years ago

andy5995 commented 6 years ago

https://github.com/theimpossibleastronaut/modemu2k/blob/3e0ab8e3200718c556b5af7647e7d81c284dcf37/src/cmdarg.c#L48

linton-dawson commented 6 years ago

Hello ! I'm interested in working on this issue. Could you please elaborate the issue though ? I am fairly new to this.

andy5995 commented 6 years ago

Hi @linton-dawson

If you build the program, and give it the --help option, it will spit out the message that it's an invalid option. When --help is given, it should show the usage.

It should do the same thing as when -h is given.

andy5995 commented 6 years ago

One way to do it would be to use getopt.h

This is an example of a program getting command line options when the getopt.h header is included

https://github.com/theimpossibleastronaut/rmw/blob/9119b23b3e5a89379ab0f9624496481bd8acbb9e/src/rmw.c#L66

That single line would mean that --help would be accepted, or -h