#include <getopt.h>
/**
+ * Maximum number of commands.
+ */
+#define MAX_COMMANDS 10
+
+/**
* Maximum number of options in a command (+1)
*/
-#define MAX_OPTIONS 14
+#define MAX_OPTIONS 20
/**
* Maximum number of usage summary lines (+1)
*/
-#define MAX_LINES 8
+#define MAX_LINES 10
typedef struct command_t command_t;
typedef enum command_type_t command_type_t;
};
/**
- * Type of available commands
+ * Options of the active command.
*/
-enum command_type_t {
- CMD_HELP = 0,
- CMD_GEN,
- CMD_PUB,
- CMD_KEYID,
- CMD_SELF,
- CMD_ISSUE,
- CMD_VERIFY,
- CMD_MAX
-};
+extern struct option command_opts[];
/**
- * Options of the currently processing command.
+ * Short option string of the active command.
*/
-extern struct option command_opts[];
+extern char command_optstring[];
/**
* Register a command.
*/
-void command_register(command_type_t type, command_t command);
+void command_register(command_t command);
/**
* Dispatch commands.
/**
* Show usage information of active command.
*/
-int command_usage(command_type_t cmd, char *error);
+int command_usage(char *error);
#endif /* COMMAND_H_ @}*/