#ifndef ARGS_H #define ARGS_H #include #include #include "../hash_map/hash_map.h" enum input_type { INPUT_UNDEFINED, INPUT_FILE, INPUT_CMD, INPUT_STDIN }; struct args_options { /** Source of the input, filename or command string depending on type, NULL * if INPUT_STDIN */ const char *input_source; /** Type of the input source */ enum input_type type; /** Enable or disable pretty printing of outputs */ bool pretty_print; /** Enable or disable verbose mode */ bool verbose; }; /** * Handles command-line arguments and populates the args_options structure. * @param argc The argument count. * @param argv The argument vector. * @param options Pointer to args_options structure to be populated. * @param vars Pointer to the variables hash map. * @return 0 on success, non-zero on failure. */ int args_handler(int argc, char **argv, struct args_options *options, struct hash_map *vars); /** Prints the parsed arguments for debugging purposes. * @param options Pointer to args_options structure containing parsed options. */ void args_print(struct args_options *options); /** Prints the usage information for the program. * @param std The output stream to print to (e.g., stdout or stderr). * @param program_name The name of the program. */ void print_usage(FILE *std, const char *program_name); #endif /* ARGS_H */