diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-04-06 11:35:29 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-04-06 11:35:29 +0200 |
commit | 839629694a0245884f8d72d8573ca75ee33ac391 (patch) | |
tree | 63268cace6d0b658c9a5cc4e68fea1f4813d45ba | |
parent | 51d96fc9fb619c467669468e5d0fc39d18763d75 (diff) | |
download | pgfuse-839629694a0245884f8d72d8573ca75ee33ac391.tar.gz pgfuse-839629694a0245884f8d72d8573ca75ee33ac391.tar.bz2 |
some argument reading fixes
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | pgfuse.c | 21 |
2 files changed, 11 insertions, 14 deletions
@@ -1,9 +1,9 @@ all: pgfuse # for debugging -CFLAGS = -Wall -Wextra -pedantic -g +CFLAGS = -Wall -g -O0 # for releasing -CFLAGS = -Wall +#CFLAGS = -Wall -O2 # declare version of FUSE API we want to program against CFLAGS += -DFUSE_USE_VERSION=26 @@ -159,9 +159,15 @@ static void print_usage( char* progname ) ); } -static int parse_args( int argc, char *argv[] ) -{ +/* --- main --- */ + +int main( int argc, char *argv[] ) +{ + int res; struct fuse_args args = FUSE_ARGS_INIT( argc, argv ); + + memset( &pgfuse, 0, sizeof( pgfuse ) ); + if( fuse_opt_parse( &args, &pgfuse, pgfuse_opts, pgfuse_opt_proc ) == -1 ) { if( pgfuse.print_help ) { /* print our options */ @@ -180,17 +186,8 @@ static int parse_args( int argc, char *argv[] ) } return EXIT_SUCCESS; -} -/* --- main --- */ + res = fuse_main( argc, argv, &pgfuse_oper, NULL ); -int main( int argc, char *argv[] ) -{ - int res; - - memset( &pgfuse, 0, sizeof( pgfuse ) ); - - res = parse_args( argc, argv ); - exit( res ); } |