Skip 'new' otherwise BSD getopt will think there are no options.
IMO 'new' should be dropped entirely since it's not optional and 'new' is the only choice. If it were to change in future then it should go after all the options. (closes #111)
This commit is contained in:
committed by
Keith Winstein
parent
1f34a08346
commit
3d76ec8208
@@ -131,7 +131,7 @@ int main( int argc, char *argv[] )
|
||||
&& (strcmp( argv[ 1 ], "new" ) == 0) ) {
|
||||
/* new option syntax */
|
||||
int opt;
|
||||
while ( (opt = getopt( argc, argv, "i:p:c:s" )) != -1 ) {
|
||||
while ( (opt = getopt( argc - 1, argv + 1, "i:p:c:s" )) != -1 ) {
|
||||
switch ( opt ) {
|
||||
case 'i':
|
||||
desired_ip = optarg;
|
||||
|
||||
Reference in New Issue
Block a user