diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 15:52:48 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 15:52:48 +0000 |
commit | 24dd70cc113d0730a3b1d744a55df7a96db870a6 (patch) | |
tree | d09e56a8dbf8c831645dc94c17f9d3427160231b /chrome/installer | |
parent | dc0b6d3ae9bead76cfffd61f15541a6d3d831f31 (diff) | |
download | chromium_src-24dd70cc113d0730a3b1d744a55df7a96db870a6.zip chromium_src-24dd70cc113d0730a3b1d744a55df7a96db870a6.tar.gz chromium_src-24dd70cc113d0730a3b1d744a55df7a96db870a6.tar.bz2 |
Add a --force command line option to the alternate_version_generator to allow for unconditional overwriting of the output file.
BUG=NONE
TEST=Run alternate_version_generator.exe --force in a directory that already has a mini_installer.exe and a mini_installer_new.exe, observer mini_installer_new.exe get regenerated.
Review URL: http://codereview.chromium.org/6546027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/test/alternate_version_generator_main.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/installer/test/alternate_version_generator_main.cc b/chrome/installer/test/alternate_version_generator_main.cc index 1a5f267..05442aa 100644 --- a/chrome/installer/test/alternate_version_generator_main.cc +++ b/chrome/installer/test/alternate_version_generator_main.cc @@ -24,6 +24,7 @@ const wchar_t kDefaultOutPath[] = L"mini_installer_new.exe"; namespace switches { +const char kForce[] = "force"; const char kHelp[] = "help"; const char kMiniInstaller[] = "mini_installer"; const char kOut[] = "out"; @@ -74,6 +75,7 @@ void DumpUsage(const CommandLine& cmd_line, L"Usage: %s [ OPTIONS ]\n" L" Where OPTIONS is one or more of:\n" L" --help Display this help message.\n" +L" --force Overwrite any existing output files.\n" L" --mini_installer=SRC_PATH Path to mini_installer.exe. Default value is\n" L" \"mini_installer.exe\" in the same directory as\n" L" this program.\n" @@ -146,7 +148,7 @@ int wmain(int argc, wchar_t *argv[]) { FilePath out; GetOutPath(*cmd_line, &out); - if (file_util::PathExists(out)) { + if (!cmd_line->HasSwitch(switches::kForce) && file_util::PathExists(out)) { DumpUsage(*cmd_line, errors::OUT_FILE_EXISTS, out.value()); return EXIT_FAILURE; } |