int option;
};
-static struct cmd_struct commands[] = {
+static const struct cmd_struct commands[] = {
{ "archive", NULL, 0 },
{ "buildid-cache", cmd_buildid_cache, 0 },
{ "buildid-list", cmd_buildid_list, 0 },
return 0;
}
-struct option options[] = {
+static const struct option options[] = {
OPT_ARGUMENT("help", "help"),
OPT_ARGUMENT("version", "version"),
OPT_ARGUMENT("exec-path", "exec-path"),
unsigned int i;
for (i = 0; i < ARRAY_SIZE(commands); i++) {
- struct cmd_struct *p = commands+i;
+ const struct cmd_struct *p = commands + i;
printf("%s ", p->cmd);
}
putchar('\n');
unsigned int i;
for (i = 0; i < ARRAY_SIZE(options)-1; i++) {
- struct option *p = options+i;
+ const struct option *p = options + i;
printf("--%s ", p->long_name);
}
putchar('\n');
#define RUN_SETUP (1<<0)
#define USE_PAGER (1<<1)
-static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
+static int run_builtin(const struct cmd_struct *p, int argc, const char **argv)
{
int status;
struct stat st;
}
for (i = 0; i < ARRAY_SIZE(commands); i++) {
- struct cmd_struct *p = commands+i;
+ const struct cmd_struct *p = commands+i;
if (p->fn == NULL)
continue;
if (strcmp(p->cmd, cmd))