- add_prefix_cmd ("apply", class_run, thread_apply_command,
- _("Apply a command to a list of threads."),
- &thread_apply_list, "thread apply ", 1, &thread_cmd_list);
-
- add_cmd ("all", class_run, thread_apply_all_command,
- _("Apply a command to all threads."), &thread_apply_list);
+#define THREAD_APPLY_OPTION_HELP "\
+Prints per-inferior thread number and target system's thread id\n\
+followed by COMMAND output.\n\
+\n\
+By default, an error raised during the execution of COMMAND\n\
+aborts \"thread apply\".\n\
+\n\
+Options:\n\
+%OPTIONS%"
+
+ const auto thread_apply_opts = make_thread_apply_options_def_group (nullptr);
+
+ static std::string thread_apply_help = gdb::option::build_help (_("\
+Apply a command to a list of threads.\n\
+Usage: thread apply ID... [OPTION]... COMMAND\n\
+ID is a space-separated list of IDs of threads to apply COMMAND on.\n"
+THREAD_APPLY_OPTION_HELP),
+ thread_apply_opts);
+
+ c = add_prefix_cmd ("apply", class_run, thread_apply_command,
+ thread_apply_help.c_str (),
+ &thread_apply_list, "thread apply ", 1,
+ &thread_cmd_list);
+ set_cmd_completer_handle_brkchars (c, thread_apply_command_completer);
+
+ const auto thread_apply_all_opts
+ = make_thread_apply_all_options_def_group (nullptr, nullptr);
+
+ static std::string thread_apply_all_help = gdb::option::build_help (_("\
+Apply a command to all threads.\n\
+\n\
+Usage: thread apply all [OPTION]... COMMAND\n"
+THREAD_APPLY_OPTION_HELP),
+ thread_apply_all_opts);
+
+ c = add_cmd ("all", class_run, thread_apply_all_command,
+ thread_apply_all_help.c_str (),
+ &thread_apply_list);
+ set_cmd_completer_handle_brkchars (c, thread_apply_all_command_completer);
+
+ c = add_com ("taas", class_run, taas_command, _("\
+Apply a command to all threads (ignoring errors and empty output).\n\
+Usage: taas [OPTION]... COMMAND\n\
+shortcut for 'thread apply all -s [OPTION]... COMMAND'\n\
+See \"help thread apply all\" for available options."));
+ set_cmd_completer_handle_brkchars (c, thread_apply_all_command_completer);
+
+ c = add_com ("tfaas", class_run, tfaas_command, _("\
+Apply a command to all frames of all threads (ignoring errors and empty output).\n\
+Usage: tfaas [OPTION]... COMMAND\n\
+shortcut for 'thread apply all -s -- frame apply all -s [OPTION]... COMMAND'\n\
+See \"help frame apply all\" for available options."));
+ set_cmd_completer_handle_brkchars (c, frame_apply_all_cmd_completer);