Calling tdtool without any parameter shows help, closes #21
This commit is contained in:
parent
57e74dd496
commit
3b46ada09c
1 changed files with 7 additions and 2 deletions
|
@ -3,8 +3,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "TellUsbD101.h"
|
#include "TellUsbD101.h"
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#define sleep(x) _sleep((x)*1000)
|
#define sleep(x) _sleep((x)*1000)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void print_usage( char *name ) {
|
void print_usage( char *name ) {
|
||||||
|
@ -72,6 +72,11 @@ int main(int argc, char **argv)
|
||||||
{ 0, 0, 0, 0}
|
{ 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (argc < 2) {
|
||||||
|
print_usage( argv[0] );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
while ( (optch = getopt_long(argc,argv,optstring,long_opts,&longindex)) != -1 )
|
while ( (optch = getopt_long(argc,argv,optstring,long_opts,&longindex)) != -1 )
|
||||||
switch (optch) {
|
switch (optch) {
|
||||||
case 'f' :
|
case 'f' :
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue