mirror of
https://github.com/michaeldv/pit.git
synced 2025-12-11 08:53:01 +00:00
Created first project saving it and reading from .pit file!
This commit is contained in:
26
src/pit.c
26
src/pit.c
@@ -1,21 +1,45 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "pit.h"
|
||||
#include "project.h"
|
||||
#include "task.h"
|
||||
|
||||
PTable projects;
|
||||
PTable tasks;
|
||||
PTable notes;
|
||||
PTable activities;
|
||||
PTable users;
|
||||
|
||||
static int usage() {
|
||||
printf("usage...\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
void die(char *msg)
|
||||
{
|
||||
fprintf(stderr, "pit (fatal): %s\n", msg);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void die_with_errno(char *prefix)
|
||||
{
|
||||
fprintf(stderr, "pit (fatal): %s: ", prefix);
|
||||
perror(NULL);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int i;
|
||||
char *commands[] = { "project", "task", "note", "log" };
|
||||
|
||||
/***
|
||||
int i;
|
||||
printf("argc: %d\n", argc);
|
||||
for(i = 0; i < argc; i++) {
|
||||
printf("argv[%d]: [%s]\n", i, argv[i]);
|
||||
}
|
||||
***/
|
||||
|
||||
if (argc > 1) {
|
||||
if (strstr(commands[0], argv[1]) == commands[0]) {
|
||||
|
||||
Reference in New Issue
Block a user