diff --git a/src/false.c b/src/false.c index d334915..a044a69 100644 --- a/src/false.c +++ b/src/false.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2007 Pierre Pronchery */ +/* Copyright (c) 2009 Pierre Pronchery */ /* This file is part of DeforaOS Unix utils */ /* utils is not free software; you can redistribute it and/or modify it under * the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 @@ -16,8 +16,28 @@ -/* main */ -int main(void) +#include +#include + + +/* usage */ +static int _usage(void) { + fputs("Usage: false\n", stderr); + return 1; +} + + +/* main */ +int main(int argc, char * argv[]) +{ + int o; + + while((o = getopt(argc, argv, "")) != -1) + switch(o) + { + default: + return _usage(); + } return 1; } diff --git a/src/true.c b/src/true.c index 64e0447..cc1878a 100644 --- a/src/true.c +++ b/src/true.c @@ -16,8 +16,28 @@ -/* main */ -int main(void) +#include +#include + + +/* usage */ +static int _usage(void) { + fputs("Usage: true\n", stderr); + return 1; +} + + +/* main */ +int main(int argc, char * argv[]) +{ + int o; + + while((o = getopt(argc, argv, "")) != -1) + switch(o) + { + default: + return _usage(); + } return 0; }