22 |
|
cse::String sitemap(_B("sitemap.gz")); |
23 |
|
_L<_R<Command> > commands; |
24 |
|
|
25 |
< |
api::Pcre::RegEx sitemap_(_B("^-sitemap=(.+)$")), fs(_B("^-fs=(.*)$")); |
25 |
> |
api::Pcre::RegEx sitemap_(_B("^-sitemap=(.+)$")), fs_(_B("^-fs=(.*)$")), exclude(_B("^-exclude=(.+)$")); |
26 |
|
|
27 |
|
_foreach (const app::ArgumentList, arg, app::GetArguments()) |
28 |
|
{ |
29 |
|
api::Pcre::RegEx::Match match; |
30 |
+ |
_R<FileSystemCommand> fs; |
31 |
|
|
32 |
|
if (match = sitemap_(*arg)) |
33 |
|
sitemap = match[1]; |
34 |
< |
else if (match = fs(*arg)) |
34 |
> |
else if (match = fs_(*arg)) |
35 |
|
commands.InsertLast(new _H<FileSystemCommand>(match[1])); |
36 |
+ |
else if (commands.GetSize() && (fs = dynamic_cast<FileSystemCommand *>(commands.Last().GetValue())) && (match = exclude(*arg))) |
37 |
+ |
fs->excludes.InsertLast(match[1]); |
38 |
|
else |
39 |
|
{ |
40 |
< |
api::Cout << _B("Usage: ") << api::GetExecutablePath().GetName() << _B(" [-sitemap=.+] [-fs=.*]") << ios::NewLine; |
40 |
> |
api::Cout << _B("Usage: ") << api::GetExecutablePath().GetName() << _B(" [-sitemap=.+] [-fs=.* [-exclude=.+] ...] ...") << ios::NewLine; |
41 |
|
|
42 |
|
return 1; |
43 |
|
} |