Support -v switch
This commit is contained in:
parent
43643aa3de
commit
7dce485863
2 changed files with 8 additions and 1 deletions
8
main.c
8
main.c
|
@ -23,6 +23,8 @@
|
||||||
#include "nmrpd.h"
|
#include "nmrpd.h"
|
||||||
#include "ethsock.h"
|
#include "ethsock.h"
|
||||||
|
|
||||||
|
int verbosity = 0;
|
||||||
|
|
||||||
void usage(FILE *fp)
|
void usage(FILE *fp)
|
||||||
{
|
{
|
||||||
fprintf(fp,
|
fprintf(fp,
|
||||||
|
@ -37,6 +39,7 @@ void usage(FILE *fp)
|
||||||
" -t <timeout> Timeout (in milliseconds) for regular messages\n"
|
" -t <timeout> Timeout (in milliseconds) for regular messages\n"
|
||||||
" -T <timeout> Time to wait after successfull TFTP upload\n"
|
" -T <timeout> Time to wait after successfull TFTP upload\n"
|
||||||
" -p <port> Port to use for TFTP upload\n"
|
" -p <port> Port to use for TFTP upload\n"
|
||||||
|
" -v Be verbose\n"
|
||||||
" -V Print version and exit\n"
|
" -V Print version and exit\n"
|
||||||
" -L List network interfaces\n"
|
" -L List network interfaces\n"
|
||||||
" -h Show this screen\n"
|
" -h Show this screen\n"
|
||||||
|
@ -72,7 +75,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "a:f:i:m:M:p:t:T:hLV")) != -1) {
|
while ((c = getopt(argc, argv, "a:f:i:m:M:p:t:T:hLVv")) != -1) {
|
||||||
max = 0x7fffffff;
|
max = 0x7fffffff;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
|
@ -112,6 +115,9 @@ int main(int argc, char **argv)
|
||||||
case 'V':
|
case 'V':
|
||||||
printf("nmrp-flash v%s\n", NMRPD_VERSION);
|
printf("nmrp-flash v%s\n", NMRPD_VERSION);
|
||||||
return 0;
|
return 0;
|
||||||
|
case 'v':
|
||||||
|
++verbosity;
|
||||||
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
return ethsock_list_all();
|
return ethsock_list_all();
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|
1
nmrpd.h
1
nmrpd.h
|
@ -70,5 +70,6 @@ int sock_set_rx_timeout(int sock, unsigned msec);
|
||||||
int tftp_put(struct nmrpd_args *args);
|
int tftp_put(struct nmrpd_args *args);
|
||||||
int nmrp_do(struct nmrpd_args *args);
|
int nmrp_do(struct nmrpd_args *args);
|
||||||
|
|
||||||
|
extern int verbosity;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue