getting fancy with command line args

This commit is contained in:
2025-11-05 20:12:09 -05:00
parent 574c58ae5e
commit 0ecf32be69
3 changed files with 177 additions and 62 deletions

26
src/args.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef ARGS_H
#define ARGS_H
#include <time.h>
typedef enum {
MODE_TODAY,
MODE_ALL,
MODE_DATE,
MODE_YEAR
} OutputMode;
typedef struct {
OutputMode mode;
struct tm target_date;
int target_year;
} ProgramArgs;
// Parse command line arguments
// Returns 0 on success, -1 on error, 1 if help was shown
int parse_args(int argc, char *argv[], ProgramArgs *args);
// Print usage information
void print_usage(const char *program_name);
#endif // ARGS_H