Skip to content

Commit

Permalink
removed trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Asmuth committed Feb 18, 2012
1 parent 6141674 commit b1b59e6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
4 changes: 2 additions & 2 deletions include/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#define LICENSE_STRING "Copyright © 2012\n" \
" Paul Asmuth <[email protected]> \n" \
" Mikael Voss <[email protected]>\n"
" Mikael Voss <[email protected]>\n"

#define USAGE_STRING "usage:" \
" %s [-xnvh] [--redis|--varnish|--memcached SERVER]... [PATTERN]... \n" \
Expand Down Expand Up @@ -54,4 +54,4 @@
" use redis database number DB (default is zero) \n" \
"\n\n"

#endif
#endif
4 changes: 2 additions & 2 deletions src/base_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class BaseAdapter {
protected:
struct ev_loop* ev;
char* address;
std::vector<std::string> patterns;
std::vector<std::string> patterns;

public:
BaseAdapter(struct ev_loop* ev_, char* address_) : ev(ev_), address(address_){
Expand All @@ -13,4 +13,4 @@ class BaseAdapter {
/* store patterns in patterns member var */
}

};
};
44 changes: 21 additions & 23 deletions src/fastpurge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@

void usage(char* binary){
printf(
VERSION_STRING,
VERSION_MAJOR,
VERSION_MINOR,
VERSION_STRING,
VERSION_MAJOR,
VERSION_MINOR,
VERSION_PATCH
);
printf(
USAGE_STRING,
USAGE_STRING,
binary
);
}

void version(){
printf(
VERSION_STRING,
VERSION_MAJOR,
VERSION_MINOR,
VERSION_STRING,
VERSION_MAJOR,
VERSION_MINOR,
VERSION_PATCH
);
printf(LICENSE_STRING);
Expand All @@ -46,12 +46,12 @@ int main(int argc, char* argv[]){
int c;

struct ev_loop* ev = ev_default_loop(0);

while (1) {
int option_index = 0;
int option_index = 0;
static struct option long_options[] =
{
{"redis", 1, no_argument, ADAPTER_REDIS},
{"redis", 1, no_argument, ADAPTER_REDIS},
{"memcached", 1, no_argument, ADAPTER_MEMCACHED},
{"varnish", 1, no_argument, ADAPTER_VARNISH},
{"help", 0, no_argument, 'h'},
Expand All @@ -60,24 +60,24 @@ int main(int argc, char* argv[]){
{"regex", 0, &use_regex, 'x'},
{0, 0, 0, 0}
};

c = getopt_long (argc, argv, "abc:d:f:", long_options, &option_index);

if (c == -1)
break;

switch (c) {

case ADAPTER_REDIS:
adapters.push_back(new BaseAdapter(ev, optarg));
adapters.push_back(new BaseAdapter(ev, optarg));
break;

case ADAPTER_MEMCACHED:
/*add_adapter(&adapter_configs, ADAPTER_MEMCACHED, optarg);*/
printf("not yet implemented\n");
break;

case ADAPTER_VARNISH:
/*add_adapter(&adapter_configs, ADAPTER_VARNISH, optarg);*/
printf("not yet implemented\n");
break;

case 'v':
Expand All @@ -88,27 +88,25 @@ int main(int argc, char* argv[]){
usage(argv[0]);
exit(0);

default:
default:
break;

}
}

dry_run = !!dry_run;
use_regex = !!use_regex;
use_regex = !!use_regex;

if (optind < argc) {
while (optind < argc)
patterns.push_back(argv[optind++]);
patterns.push_back(argv[optind++]);
}

if (adapters.size() == 0) {
printf("ERROR: no adapters\n");
printf("ERROR: no adapters\n");
printf(" --help for more information\n");
return 1;
}

/* initialize all adapters from adapter_configs */
}

/* TODO: Actually do something */

Expand Down

0 comments on commit b1b59e6

Please sign in to comment.