#ifndef POTC_ARGS_H
#define POTC_ARGS_H

#include <stdbool.h>
#include <stddef.h>

#define MAX_FILES 16
#define MAX_TEXTS 16
#define MAX_INDICES 16
#define MAX_PROOFS 64

typedef enum {
    CMD_NONE,
    CMD_SEQUINCLUSION_GENERATE,
    CMD_SEQUINCLUSION_VERIFY,
    CMD_TRANSCLUSION_GENERATE,
    CMD_TRANSCLUSION_VERIFY,
    CMD_SINGLEHASH
} Command;

typedef struct {
    size_t start;
    size_t end;
} Index;

typedef struct {
    Command command;

    // Files and texts
    char* files[MAX_FILES];
    int file_count;
    char* texts[MAX_TEXTS];
    int text_count;

    // Indices
    Index indices[MAX_INDICES];
    int index_count;

    // Index base
    int index_base;  // -1 = not set, 0 = zero-indexed, 1 = one-indexed

    // Proofs
    char* proofs[MAX_PROOFS];
    int proof_count;

    // Flags
    bool help;
    bool version;
} Args;

void print_main_help(void);
void print_sequinclusion_help(void);
void print_transclusion_help(void);
void print_version(void);
Args parse_args(int argc, char** argv);
int parse_range(const char* s, Index* index);

#endif
