ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/GoogleTron/GoogleTron.cpp
(Generate patch)

Comparing GoogleTron/GoogleTron.cpp (file contents):
Revision 686 by douglas, 2006-03-06T17:40:59-08:00 vs.
Revision 687 by douglas, 2006-03-06T18:05:20-08:00

# Line 22 | Line 22 | int Main(const app::Options &options)
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                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines