MySQL 8.0.40
Source Code Documentation
help_options.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2014, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef HELP_OPTIONS_INCLUDED
27#define HELP_OPTIONS_INCLUDED
28
30#include "my_compiler.h"
31
32namespace Mysql {
33namespace Tools {
34namespace Base {
35
36class Abtract_program;
37
38namespace Options {
39
40/**
41 Options provider providing --help option and handling usage printing.
42 */
44 public:
45 /**
46 Constructs new help options provider.
47 @param program Pointer to main program class, used to collect list of all
48 options available in program.
49 */
50 explicit Help_options(Base::Abstract_program *program);
51 /**
52 Creates all options that will be provided.
53 Implementation of Abstract_options_provider virtual method.
54 */
55 void create_options() override;
56 /**
57 Prints program usage message.
58 */
59 virtual void print_usage();
60
61 private:
62 void help_callback(char *argument [[maybe_unused]]);
63 void version_callback(char *argument [[maybe_unused]]);
64
65 void print_version_line();
66
68};
69
70} // namespace Options
71} // namespace Base
72} // namespace Tools
73} // namespace Mysql
74
75#endif
Base class for all MySQL client tools.
Definition: abstract_program.h:47
Common abstract class for options providers.
Definition: abstract_options_provider.h:55
Options provider providing –help option and handling usage printing.
Definition: help_options.h:43
void create_options() override
Creates all options that will be provided.
Definition: help_options.cc:47
Help_options(Base::Abstract_program *program)
Constructs new help options provider.
Definition: help_options.cc:45
void version_callback(char *argument)
Definition: help_options.cc:64
void help_callback(char *argument)
Definition: help_options.cc:59
void print_version_line()
A helper function.
Definition: help_options.cc:70
Abstract_program * m_program
Definition: help_options.h:67
virtual void print_usage()
Prints program usage message.
Definition: help_options.cc:72
Header for compiler-dependent features.
constexpr pos_type Options
Definition: http_request.h:261
Definition: abstract_connection_program.h:38