diff options
-rw-r--r-- | src/satq.c | 27 | ||||
-rw-r--r-- | src/satr.c | 25 |
2 files changed, 52 insertions, 0 deletions
@@ -19,12 +19,39 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ +#include <stdio.h> +#include <stdlib.h> +/** + * The name of the process. + */ +char *argv0 = "satq"; + + + +/** + * Print usage information. + */ +static void +usage(void) +{ + fprintf(stderr, "usage: %s\n", + strrchr(argv0) ? (strrchr(argv0) + 1) : argv0); + exit(2); +} + + int main(int argc, char *argv[]) { + if (argc > 1) { + usage(); + } else if (argc == 1) { + argv0 = argv[0]; + } + /* TODO print the job queue */ } @@ -22,9 +22,34 @@ +/** + * The name of the process. + */ +char *argv0 = "satr"; + + + +/** + * Print usage information. + */ +static void +usage(void) +{ + fprintf(stderr, "usage: %s\n", + strrchr(argv0) ? (strrchr(argv0) + 1) : argv0); + exit(2); +} + + int main(int argc, char *argv[]) { + if (argc > 1) { + usage(); + } else if (argc == 1) { + argv0 = argv[0]; + } + /* TODO tell the daemon to start running jobs even if it is not time yet. */ } |