Lines Matching refs:cmd
52 const char *cmd; member
95 const char *cmd; member
102 if (strstarts(var, "pager.") && !strcmp(var + 6, c->cmd)) in pager_command_config()
108 static int check_pager_config(const char *cmd) in check_pager_config() argument
112 c.cmd = cmd; in check_pager_config()
121 if (strstarts(var, "tui.") && !strcmp(var + 4, c->cmd)) in browser_command_config()
123 if (strstarts(var, "gtk.") && !strcmp(var + 4, c->cmd)) in browser_command_config()
132 static int check_browser_config(const char *cmd) in check_browser_config() argument
136 c.cmd = cmd; in check_browser_config()
176 const char *cmd = (*argv)[0]; in handle_options() local
177 if (cmd[0] != '-') in handle_options()
185 if (!strcmp(cmd, "--help") || !strcmp(cmd, "--version")) in handle_options()
192 if (!strcmp(cmd, "-h")) { in handle_options()
197 if (!strcmp(cmd, "-v")) { in handle_options()
202 if (!strcmp(cmd, "-vv")) { in handle_options()
211 if (strstarts(cmd, CMD_EXEC_PATH)) { in handle_options()
212 cmd += strlen(CMD_EXEC_PATH); in handle_options()
213 if (*cmd == '=') in handle_options()
214 set_argv_exec_path(cmd + 1); in handle_options()
219 } else if (!strcmp(cmd, "--html-path")) { in handle_options()
222 } else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) { in handle_options()
224 } else if (!strcmp(cmd, "--no-pager")) { in handle_options()
228 } else if (!strcmp(cmd, "--debugfs-dir")) { in handle_options()
238 } else if (!strcmp(cmd, "--buildid-dir")) { in handle_options()
248 } else if (strstarts(cmd, CMD_DEBUGFS_DIR)) { in handle_options()
249 tracing_path_set(cmd + strlen(CMD_DEBUGFS_DIR)); in handle_options()
253 } else if (!strcmp(cmd, "--list-cmds")) { in handle_options()
258 printf("%s ", p->cmd); in handle_options()
262 } else if (!strcmp(cmd, "--list-opts")) { in handle_options()
271 } else if (!strcmp(cmd, "--debug")) { in handle_options()
282 fprintf(stderr, "Unknown option: %s\n", cmd); in handle_options()
303 use_browser = check_browser_config(p->cmd); in run_builtin()
306 use_pager = check_pager_config(p->cmd); in run_builtin()
352 const char *cmd = argv[0]; in handle_internal_command() local
358 argv[0] = cmd = "help"; in handle_internal_command()
363 if (strcmp(p->cmd, cmd)) in handle_internal_command()
371 char *cmd; in execv_dashed_external() local
375 if (asprintf(&cmd, "perf-%s", argv[0]) < 0) in execv_dashed_external()
385 argv[0] = cmd; in execv_dashed_external()
403 zfree(&cmd); in execv_dashed_external()
443 const char *cmd; in main() local
454 cmd = extract_argv0_path(argv[0]); in main()
455 if (!cmd) in main()
456 cmd = "perf-help"; in main()
480 if (strstarts(cmd, "perf-")) { in main()
481 cmd += 5; in main()
482 argv[0] = cmd; in main()
488 cmd -= 5; in main()
489 argv[0] = cmd; in main()
491 if (strstarts(cmd, "trace")) { in main()
518 cmd = argv[0]; in main()
545 cmd = argv[0] = help_unknown_cmd(cmd); in main()
552 cmd, str_error_r(errno, sbuf, sizeof(sbuf))); in main()