File tree 4 files changed +32
-2
lines changed
regression-tests/test-results
4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1
1
2
- cppfront compiler v0.7.1 Build 9717:1027
2
+ cppfront compiler v0.7.1 Build 9718:1445
3
3
Copyright(c) Herb Sutter All rights reserved
4
4
5
5
SPDX-License-Identifier: CC-BY-NC-ND-4.0
Original file line number Diff line number Diff line change 1
- "9717:1027 "
1
+ "9718:1445 "
Original file line number Diff line number Diff line change @@ -669,6 +669,18 @@ class cmdline_processor
669
669
}
670
670
671
671
public:
672
+ auto flags_starting_with (std::string_view s)
673
+ -> std::vector<std::string>
674
+ {
675
+ auto ret = std::vector<std::string>{};
676
+ for (auto const & f : flags) {
677
+ if (f.name .starts_with (s)) {
678
+ ret.push_back (f.name );
679
+ }
680
+ }
681
+ return ret;
682
+ }
683
+
672
684
auto process_flags ()
673
685
-> void
674
686
{
Original file line number Diff line number Diff line change @@ -61,6 +61,24 @@ auto main(
61
61
int exit_status = EXIT_SUCCESS;
62
62
for (auto const & arg : cmdline.arguments ())
63
63
{
64
+ if (
65
+ arg.text .starts_with (" -" )
66
+ || arg.text .starts_with (" /" )
67
+ )
68
+ {
69
+ auto ambiguous = cmdline.flags_starting_with (arg.text .substr (1 ));
70
+ if (ambiguous.empty ()) {
71
+ std::cerr << arg.text << " - unknown compiler flag name (try " << arg.text .front () << " help)\n " ;
72
+ }
73
+ else {
74
+ std::cerr << arg.text << " - ambiguous compiler flag name, did you mean one of these?\n " ;
75
+ for (auto a : ambiguous) {
76
+ std::cerr << " " << arg.text .front () << a << " \n " ;
77
+ }
78
+ }
79
+ return EXIT_FAILURE;
80
+ }
81
+
64
82
cpp2::timer t;
65
83
t.start ();
66
84
You can’t perform that action at this time.
0 commit comments