uptime.c 385 Bytes
Newer Older
csmall's avatar
csmall committed
1
#include <stdio.h>
csmall's avatar
csmall committed
2 3 4 5 6
#include <string.h>
#include "proc/whattime.h"
#include "proc/version.h"

int main(int argc, char *argv[]) {
csmall's avatar
csmall committed
7 8 9 10 11 12 13 14
    if(argc == 1) {
        print_uptime();
        return 0;
    }
    if((argc == 2) && (!strcmp(argv[1], "-V"))) {
        display_version();
        return 0;
    }
albert's avatar
albert committed
15
    fprintf(stderr, "usage: uptime [-V]\n    -V    display version\n");
csmall's avatar
csmall committed
16
    return 1;
csmall's avatar
csmall committed
17
}