getting fancy with command line args
This commit is contained in:
26
src/args.h
Normal file
26
src/args.h
Normal 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
|
||||
Reference in New Issue
Block a user