return 0;
}
+static void usage( const char *me )
+{
+ const char *p;
+ if ( NULL != ( p = strrchr( me, '/' ) ) )
+ me = ++p;
+ fprintf( stderr, "Usage: %s [options]\n", me );
+ fprintf( stderr,
+ " Options:\n"
+ " -b str bind interface; default: * (all)\n"
+ " -h str host name; default: localhost\n"
+ " -i file file to serve as index file; default: index.html\n"
+ " -o str origin; default: http://localhost\n"
+ " -p N TCP listen port; default: 8837\n"
+ );
+}
+
static int config( int argc, char *argv[] ) {
int opt;
const char *ostr = "+b:h:i:o:p:";
break;
case ':':
EPRINT( "Missing argument for option '%c'\n", optopt );
+ usage( argv[0] );
return -1;
break;
case '?':
default:
EPRINT( "Unrecognized option '%c'\n", optopt );
+ usage( argv[0] );
return -1;
break;
}