36#define SPECLIST_TAG cmdarg
37#define SPECLIST_TYPE struct cmdarg
39#define cmdarg_list_iterate(cmdarg_list, pcmdarg) \
40 TYPED_LIST_ITERATE(struct cmdarg, cmdarg_list, pcmdarg)
41#define cmdarg_list_iterate_end LIST_ITERATE_END
52 const struct cmdarg *
const *pcmdarg1);
87 const char *longarg,
const char *helpstr, ...)
98 cmdarg_list_append(pcmdhelp->
cmdarglist, pcmdarg);
107 fc_fprintf(stderr,
_(
"Usage: %s [option ...]\nValid option are:\n"),
112 if (pcmdarg->shortarg !=
'\0') {
113 fc_fprintf(stderr,
" -%c, --%-15s %s\n", pcmdarg->shortarg,
114 pcmdarg->longarg, pcmdarg->helpstr);
116 fc_fprintf(stderr,
" --%-15s %s\n", pcmdarg->longarg,
124 fc_snprintf(buf,
sizeof(buf),
_(
"Try \"%s -- --help\" for more."),
130 _(
"Pass any following options to the UI."));
136 fc_fprintf(stderr,
_(
"Report bugs at %s\n"), BUG_URL);
180 const struct cmdarg *
const *pp1)
182 const struct cmdarg *pcmdarg0 = *pp0;
183 const struct cmdarg *pcmdarg1 = *pp1;
186 if (pcmdarg0 == NULL) {
189 if (pcmdarg1 == NULL) {
211 return (
int) (
unsigned char)pcmdarg0->
shortarg
212 - (
int) (
unsigned char)pcmdarg1->
shortarg;
static struct cmdarg * cmdarg_new(const char *shortarg, const char *longarg, const char *helpstr)
static int cmdarg_compare(const struct cmdarg *const *pcmdarg0, const struct cmdarg *const *pcmdarg1)
void cmdhelp_destroy(struct cmdhelp *pcmdhelp)
#define cmdarg_list_iterate(cmdarg_list, pcmdarg)
void cmdhelp_display(struct cmdhelp *pcmdhelp, bool sort, bool gui_options, bool report_bugs)
#define cmdarg_list_iterate_end
static void cmdarg_destroy(struct cmdarg *pcmdarg)
struct cmdhelp * cmdhelp_new(const char *cmdname)
void cmdhelp_add(struct cmdhelp *pcmdhelp, const char *shortarg, const char *longarg, const char *helpstr,...)
void fc_fprintf(FILE *stream, const char *format,...) fc__attribute((__format__(__printf__
#define fc_calloc(n, esz)
struct client_options gui_options
struct cmdarg_list * cmdarglist
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
const char * fc_basename(const char *path)