# HG changeset patch # User bears # Date 961878998 -3600 # Node ID af7bea7515b2ba48e1ff4b26f0f0672efc75e86e # Parent 70bd4379b233b9d63afa04eab8a65e52736b0d8b [svn] --post simplification. diff -r 70bd4379b233 -r af7bea7515b2 src/noffle.c --- a/src/noffle.c Sat Jun 24 21:30:45 2000 +0100 +++ b/src/noffle.c Sat Jun 24 21:36:38 2000 +0100 @@ -10,7 +10,7 @@ received for some seconds (to allow multiple clients connect at the same time). - $Id: noffle.c 135 2000-06-05 08:57:05Z bears $ + $Id: noffle.c 158 2000-06-24 20:36:38Z bears $ */ #if HAVE_CONFIG_H @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -176,7 +177,7 @@ } static Bool -doPost( Bool localOnly ) +doPost() { Str line; DynStr *s; @@ -193,7 +194,7 @@ fprintf( stderr, "Post failed: Malformed article.\n" ); res = FALSE; } - else if ( ! Post_post( localOnly ) ) + else if ( ! Post_post() ) { fprintf( stderr, "Post failed: Can't post to group.\n" ); res = FALSE; @@ -528,8 +529,7 @@ " -m | --modify post (y|n) Modify posting status of a local group\n" " -n | --online Switch to online mode\n" " -o | --offline Switch to offline mode\n" - " -p | --post all Post article on stdin to all groups\n" - " -p | --post local Post article on stdin to local groups\n" + " -p | --post Post article on stdin\n" " -q | --query groups Get group list from server\n" " -q | --query desc Get group descriptions from server\n" " -q | --query times Get group creation times from server\n" @@ -650,7 +650,7 @@ { "modify", required_argument, NULL, 'm' }, { "offline", no_argument, NULL, 'o' }, { "online", no_argument, NULL, 'n' }, - { "post", required_argument, NULL, 'p' }, + { "post", no_argument, NULL, 'p' }, { "query", required_argument, NULL, 'q' }, { "server", no_argument, NULL, 'r' }, { "requested", no_argument, NULL, 'R' }, @@ -669,7 +669,7 @@ signal( SIGINT, logSignal ); signal( SIGTERM, logSignal ); signal( SIGPIPE, logSignal ); - c = getopt_long( argc, argv, "a:c:C:dD:efghlm:onp:q:rRs:S:t:u:v", + c = getopt_long( argc, argv, "a:c:C:dD:efghlm:onpq:rRs:S:t:u:v", longOptions, NULL ); if ( ! initNoffle( c != 'r' ) ) return EXIT_FAILURE; @@ -757,26 +757,8 @@ Online_set( FALSE ); break; case 'p': - if ( ! optarg ) - { - fprintf( stderr, "Option -p needs argument.\n" ); - result = EXIT_FAILURE; - } - else - { - Bool local; - - local = FALSE; - if ( strcmp( optarg, "local" ) == 0 ) - local = TRUE; - else if ( strcmp( optarg, "all" ) != 0 ) - { - fprintf( stderr, "Unknown argument -p %s\n", optarg ); - result = EXIT_FAILURE; - } - if ( ! doPost( local ) ) - result = EXIT_FAILURE; - } + if ( ! doPost() ) + result = EXIT_FAILURE; break; case 'q': if ( ! optarg )