@@ -77,6 +77,20 @@ class vector_of_string : public std::vector<std::string>
7777 * The meta information is assembled in a struct to provide a central access
7878 * point that can be easily extended.
7979 *
80+ * ### Subparser
81+ *
82+ * When \link subcommand_parse using a subparser \endlink, the subcommand will be appended to the
83+ * subparser's #app_name.
84+ * Additionally, the following metadata will be copied from the top-level parser to the sub-parser:
85+ * * #version
86+ * * #author
87+ * * #email
88+ * * #date
89+ * * #url
90+ * * #short_copyright
91+ * * #long_copyright
92+ * * #citation
93+ *
8094 * \remark For a complete overview, take a look at \ref parser
8195 *
8296 * \stableapi{Since version 1.0.}
@@ -88,43 +102,43 @@ struct parser_meta_data // holds all meta information
88102 * The application name must only contain alpha-numeric characters, '_' or '-',
89103 * i.e. the following regex must evaluate to true: `\"^[a-zA-Z0-9_-]+$\"`.
90104 */
91- std::string app_name;
105+ std::string app_name{} ;
92106
93107 // !\brief The version information `MAJOR.MINOR.PATH` (e.g. 3.1.3)
94- std::string version;
108+ std::string version{} ;
95109
96110 // !\brief A short description of the application (e.g. "A tool for mapping reads to the genome").
97- std::string short_description;
111+ std::string short_description{} ;
98112
99113 // !\brief Your name ;-)
100- std::string author;
114+ std::string author{} ;
101115
102116 // !\brief The author's e-mail address for correspondence.
103- std::string email;
117+ std::string email{} ;
104118
105119 /* !\brief The date that the application was last updated. Keep this updated,
106120 *! since it will tell your users that the application is maintained.
107121 */
108- std::string date;
122+ std::string date{} ;
109123
110124 // !\brief A link to your github/gitlab project with the newest release.
111- std::string url;
125+ std::string url{} ;
112126
113127 // !\brief Brief copyright (and/or license) information.
114- std::string short_copyright;
128+ std::string short_copyright{} ;
115129
116130 /* !\brief Detailed copyright information that will be displayed
117131 * when the user specifies "--copyright" on the command line.
118132 */
119- std::string long_copyright;
133+ std::string long_copyright{} ;
120134
121135 // !\brief How users shall cite your application.
122- vector_of_string citation;
136+ vector_of_string citation{} ;
123137
124138 /* !\brief The title of your man page when exported by specifying
125139 * "--export-help man" on the common line.
126140 */
127- std::string man_page_title;
141+ std::string man_page_title{} ;
128142
129143 // !\brief The man page section info (type `man man` on the command line for more information).
130144 unsigned man_page_section{1 };
@@ -134,18 +148,22 @@ struct parser_meta_data // holds all meta information
134148 * to the description vector will be treated as a paragraph and
135149 * is separated by a new line.
136150 */
137- std::vector<std::string> description;
151+ std::vector<std::string> description{} ;
138152
139153 /* !\brief Add lines of usage to the synopsis section of the help page (e.g.
140154 * "./my_read_mapper [OPTIONS] FILE1 FILE1").
141155 */
142- std::vector<std::string> synopsis;
156+ std::vector<std::string> synopsis{} ;
143157
144158 /* !\brief Provide some examples on how to use your tool and what standard
145159 * parameters might be appropriate in different cases (e.g.
146160 * "./my_read_mapper -s 3 --my_flag path/infile1").
147161 */
148- std::vector<std::string> examples;
162+ std::vector<std::string> examples{};
163+
164+ // !\cond
165+ constexpr friend bool operator ==(parser_meta_data, parser_meta_data) = default ;
166+ // !\endcond
149167};
150168
151169} // namespace sharg
0 commit comments