+/* Option definition of "thread apply"'s "-ascending" option. */
+
+static const gdb::option::flag_option_def<> ascending_option_def = {
+ "ascending",
+ N_("\
+Call COMMAND for all threads in ascending order.\n\
+The default is descending order."),
+};
+
+/* The qcs command line flags for the "thread apply" commands. Keep
+ this in sync with the "frame apply" commands. */
+
+using qcs_flag_option_def
+ = gdb::option::flag_option_def<qcs_flags>;
+
+static const gdb::option::option_def thr_qcs_flags_option_defs[] = {
+ qcs_flag_option_def {
+ "q", [] (qcs_flags *opt) { return &opt->quiet; },
+ N_("Disables printing the thread information."),
+ },
+
+ qcs_flag_option_def {
+ "c", [] (qcs_flags *opt) { return &opt->cont; },
+ N_("Print any error raised by COMMAND and continue."),
+ },
+
+ qcs_flag_option_def {
+ "s", [] (qcs_flags *opt) { return &opt->silent; },
+ N_("Silently ignore any errors or empty output produced by COMMAND."),
+ },
+};
+
+/* Create an option_def_group for the "thread apply all" options, with
+ ASCENDING and FLAGS as context. */
+
+static inline std::array<gdb::option::option_def_group, 2>
+make_thread_apply_all_options_def_group (bool *ascending,
+ qcs_flags *flags)
+{
+ return {{
+ { {ascending_option_def.def ()}, ascending},
+ { {thr_qcs_flags_option_defs}, flags },
+ }};
+}
+
+/* Create an option_def_group for the "thread apply" options, with
+ FLAGS as context. */
+
+static inline gdb::option::option_def_group
+make_thread_apply_options_def_group (qcs_flags *flags)
+{
+ return {{thr_qcs_flags_option_defs}, flags};