diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-01-23 12:24:49 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-01-23 12:24:49 +0800 |
| commit | f5006f449a7be1a2f655f1b178ecf1d2f0569dd5 (patch) | |
| tree | 46f509402cb7bb5681f8747dc160914b03010444 /src/yue.cpp | |
| parent | 02910188fc07492b8b31b2701fe1987025196f85 (diff) | |
| download | yuescript-f5006f449a7be1a2f655f1b178ecf1d2f0569dd5.tar.gz yuescript-f5006f449a7be1a2f655f1b178ecf1d2f0569dd5.tar.bz2 yuescript-f5006f449a7be1a2f655f1b178ecf1d2f0569dd5.zip | |
Diffstat (limited to 'src/yue.cpp')
| -rw-r--r-- | src/yue.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yue.cpp b/src/yue.cpp index 7e39367..f48d14b 100644 --- a/src/yue.cpp +++ b/src/yue.cpp | |||
| @@ -520,9 +520,6 @@ int main(int narg, const char** args) { | |||
| 520 | std::string workPath; | 520 | std::string workPath; |
| 521 | std::list<std::pair<std::string, std::string>> files; | 521 | std::list<std::pair<std::string, std::string>> files; |
| 522 | 522 | ||
| 523 | auto isOptionToken = [](std::string_view s) { | ||
| 524 | return !s.empty() && (s[0] == '-' || (s.size() >= 2 && s.substr(0, 2) == "--"sv)); | ||
| 525 | }; | ||
| 526 | auto takeValue = [&](int& i, std::string_view arg, std::string_view optName) -> std::string { | 523 | auto takeValue = [&](int& i, std::string_view arg, std::string_view optName) -> std::string { |
| 527 | // supports: --opt=value, --opt value, -o value, -t value, etc. | 524 | // supports: --opt=value, --opt value, -o value, -t value, etc. |
| 528 | if (auto eq = arg.find('='); eq != std::string_view::npos) { | 525 | if (auto eq = arg.find('='); eq != std::string_view::npos) { |
| @@ -697,6 +694,9 @@ int main(int narg, const char** args) { | |||
| 697 | if (resultFile.empty()) return 1; | 694 | if (resultFile.empty()) return 1; |
| 698 | } else if (arg == "-w"sv || arg == "--watch"sv || arg.rfind("--watch="sv, 0) == 0) { | 695 | } else if (arg == "-w"sv || arg == "--watch"sv || arg.rfind("--watch="sv, 0) == 0) { |
| 699 | #ifndef YUE_NO_WATCHER | 696 | #ifndef YUE_NO_WATCHER |
| 697 | auto isOptionToken = [](std::string_view s) { | ||
| 698 | return !s.empty() && (s[0] == '-' || (s.size() >= 2 && s.substr(0, 2) == "--"sv)); | ||
| 699 | }; | ||
| 700 | watchFiles = true; | 700 | watchFiles = true; |
| 701 | // accept optional directory value: -w <dir> / --watch <dir> / --watch=<dir> | 701 | // accept optional directory value: -w <dir> / --watch <dir> / --watch=<dir> |
| 702 | if (arg != "-w"sv) { | 702 | if (arg != "-w"sv) { |
