GCC Middle and Back End API Reference
|
#include <opt-suggestions.h>
Public Member Functions | |
option_proposer () | |
~option_proposer () | |
const char * | suggest_option (const char *bad_opt) |
void | suggest_completion (const char *option_prefix) |
void | get_completions (const char *option_prefix, auto_string_vec &results) |
Private Member Functions | |
void | build_option_suggestions (const char *prefix) |
Private Attributes | |
auto_string_vec * | m_option_suggestions |
Provide suggestions to handle misspelled options, and implement the --complete option for auto-completing options from a prefix. Copyright (C) 2016-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Option proposer is class used by driver in order to provide hints for wrong options provided. And it's used by --complete option that's intended to be invoked by BASH in order to provide better option completion support.
|
inline |
option_proposer::~option_proposer | ( | ) |
Provide option suggestion for --complete option and a misspelled used by a user. Copyright (C) 2016-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
References m_option_suggestions.
|
private |
References add_misspelling_candidates(), cl_enum_arg::arg, cl_enums, cl_options, cl_options_count, cl_option::cl_reject_negative, CL_TARGET, CLVC_ENUM, free(), gcc_assert, i, m_option_suggestions, sanitizer_opts_s::name, NULL, cl_option::opt_text, option(), sanitizer_opts, and cl_enum::values.
Referenced by get_completions(), and suggest_option().
void option_proposer::get_completions | ( | const char * | option_prefix, |
auto_string_vec & | results ) |
Populate RESULTS with valid completions of options that begin with OPTION_PREFIX.
References build_option_suggestions(), candidate(), gcc_assert, i, m_option_suggestions, and NULL.
Referenced by suggest_completion().
void option_proposer::suggest_completion | ( | const char * | option_prefix | ) |
Print on stdout a list of valid options that begin with OPTION_PREFIX, one per line, suitable for use by Bash completion. Implementation of the "-completion=" option.
References get_completions(), and i.
Referenced by driver::main().
const char * option_proposer::suggest_option | ( | const char * | bad_opt | ) |
References build_option_suggestions(), find_closest_string(), gcc_assert, m_option_suggestions, and NULL.
Referenced by enable_warning_as_error(), and driver::handle_unrecognized_options().
|
private |
Referenced by build_option_suggestions(), get_completions(), suggest_option(), and ~option_proposer().