<arg choice="opt" rep="norepeat"><option>/m</option>
<replaceable>compare-method</replaceable></arg>
+ <arg choice="opt" rep="norepeat"><option>/t</option>
+ <replaceable>window-type</replaceable></arg>
+
<arg><option>/x</option></arg>
<arg><option>/xq</option></arg>
<secondary>applying in command line</secondary>
</indexterm>
- <term><option>/m</option></term>
+ <term><option>/m <replaceable>compare-method</replaceable></option></term>
<listitem>
<para>Sets the compare method to use for the comparison.
This can be one of the keywords <userinput>Full</userinput>,
<userinput>Quick</userinput>, <userinput>Binary</userinput>,
- <userinput>Date</userinput>, <userinput>SizeDate</userinput>,
+ <userinput>Date</userinput>, <userinput>SizeDate</userinput> or
<userinput>Size</userinput>.</para>
</listitem>
</varlistentry>
<varlistentry>
+ <indexterm>
+ <primary>window type</primary>
+ <secondary>applying in command line</secondary>
+ </indexterm>
+
+ <term><option>/t <replaceable>window-type</replaceable></option></term>
+ <listitem>
+ <para>Specifies the type of window in which to display files.
+ This can be one of the keywords <userinput>Text</userinput>,
+ <userinput>Table</userinput>, <userinput>Binary</userinput> or
+ <userinput>Image</userinput>.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>/x</option></term>
<listitem>
<para>Closes WinMerge (after displaying an information
<arg choice="opt" rep="norepeat"><option>/m</option>
<replaceable>compare-method</replaceable></arg>
+ <arg choice="opt" rep="norepeat"><option>/t</option>
+ <replaceable>window-type</replaceable></arg>
+
<arg><option>/x</option></arg>
<arg><option>/xq</option></arg>
<secondary>applying in command line</secondary>
</indexterm>
- <term><option>/m</option></term>
+ <term><option>/m <replaceable>compare-method</replaceable></option></term>
<listitem>
<para>フォルダ比較方法を指定します。
次のキーワードが指定できます。<userinput>Full</userinput>,
<userinput>Quick</userinput>, <userinput>Binary</userinput>,
- <userinput>Date</userinput>, <userinput>SizeDate</userinput>,
- <userinput>Size</userinput>.</para>
+ <userinput>Date</userinput>, <userinput>SizeDate</userinput>
+ <userinput>Size</userinput></para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <indexterm>
+ <primary>window type</primary>
+ <secondary>applying in command line</secondary>
+ </indexterm>
+
+ <term><option>/t <replaceable>window-type</replaceable></option></term>
+ <listitem>
+ <para>ファイルを表示するウインドウの種類を指定します。
+ 次のキーワードが指定できます。 <userinput>Text</userinput>,
+ <userinput>Table</userinput>, <userinput>Binary</userinput>,
+ <userinput>Image</userinput></para>
</listitem>
</varlistentry>
switch (nID)
{
case ID_MERGE_COMPARE_TEXT:
- return GetMainFrame()->ShowTextMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
+ return ShowTextMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
strDesc, sReportFile, infoUnpacker, line);
case ID_MERGE_COMPARE_TABLE:
- return GetMainFrame()->ShowTableMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
+ return ShowTableMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
strDesc, sReportFile, infoUnpacker, line);
case ID_MERGE_COMPARE_HEX:
- return GetMainFrame()->ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
+ return ShowHexMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
strDesc, sReportFile, infoUnpacker);
case ID_MERGE_COMPARE_IMAGE:
- return GetMainFrame()->ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
+ return ShowImgMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
strDesc, sReportFile, infoUnpacker);
default:
- return GetMainFrame()->ShowAutoMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
+ return ShowAutoMergeDoc(pDirDoc, nFiles, ifileloc, dwFlags,
strDesc, sReportFile, infoUnpacker, line);
}
}
* @return `true` if opening files and compare succeeded, `false` otherwise.
*/
bool CMainFrame::DoFileOpen(const PathContext * pFiles /*= nullptr*/,
- const DWORD dwFlags[] /*= nullptr*/, const String strDesc[] /*= nullptr*/, const String& sReportFile /*= T("")*/, bool bRecurse /*= false*/, CDirDoc *pDirDoc/*= nullptr*/,
- const PackingInfo *infoUnpacker /*= nullptr*/, const PrediffingInfo *infoPrediffer /*= nullptr*/, int line /*= -1*/)
+ const DWORD dwFlags[] /*= nullptr*/, const String strDesc[] /*= nullptr*/, const String& sReportFile /*= T("")*/,
+ bool bRecurse /*= false*/, CDirDoc* pDirDoc/*= nullptr*/,
+ const PackingInfo *infoUnpacker /*= nullptr*/, const PrediffingInfo *infoPrediffer /*= nullptr*/,
+ UINT nID /*= 0*/, int line /*= -1*/)
{
if (pDirDoc != nullptr && !pDirDoc->CloseMergeDocs())
return false;
}
CTempPathContext *pTempPathContext = nullptr;
- if (pathsType == paths::IS_EXISTING_DIR)
+ if (nID == 0 && pathsType == paths::IS_EXISTING_DIR)
{
DecompressResult res= DecompressArchive(m_hWnd, tFiles);
if (res.pTempPathContext)
// an archive. Don't open a new dirview if we are comparing files.
if (pDirDoc == nullptr)
{
- if (pathsType == paths::IS_EXISTING_DIR)
+ if (nID == 0 && pathsType == paths::IS_EXISTING_DIR)
{
CDirDoc::m_nDirsTemp = tFiles.GetSize();
if (m_pMenus[MENU_DIRVIEW] == nullptr)
}
// open the diff
- if (pathsType == paths::IS_EXISTING_DIR)
+ if (nID == 0 && pathsType == paths::IS_EXISTING_DIR)
{
if (pDirDoc != nullptr)
{
pDirDoc->GetPluginManager().SetPrediffer(strBothFilenames, infoPrediffer->GetPluginPipeline());
}
- ShowAutoMergeDoc(pDirDoc, tFiles.GetSize(), fileloc, dwFlags, strDesc, sReportFile,
+ ShowMergeDoc(nID, pDirDoc, tFiles.GetSize(), fileloc, dwFlags, strDesc, sReportFile,
infoUnpacker, line);
}
bool DoFileOpen(const PathContext *pFiles = nullptr,
const DWORD dwFlags[] = nullptr, const String strDesc[] = nullptr,
const String& sReportFile = _T(""), bool bRecurse = false, CDirDoc *pDirDoc = nullptr,
- const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, int line = -1);
+ const PackingInfo * infoUnpacker = nullptr, const PrediffingInfo * infoPrediffer = nullptr, UINT nID = 0, int line = -1);
bool DoFileOpen(UINT nID, const PathContext* pFiles = nullptr,
const DWORD dwFlags[] = nullptr, const String strDesc[] = nullptr,
const String& sReportFile = _T(""), const PackingInfo* infoUnpacker = nullptr, int line = -1);
String strDesc[3];
std::unique_ptr<PackingInfo> infoUnpacker;
std::unique_ptr<PrediffingInfo> infoPrediffer;
+ unsigned nID = cmdInfo.m_nWindowType == MergeCmdLineInfo::AUTOMATIC ?
+ 0 : static_cast<unsigned>(cmdInfo.m_nWindowType) + ID_MERGE_COMPARE_TEXT - 1;
m_bNonInteractive = cmdInfo.m_bNonInteractive;
DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwMiddleFlags, cmdInfo.m_dwRightFlags};
bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, nullptr,
- infoUnpacker.get(), infoPrediffer.get(), cmdInfo.m_nLineIndex);
+ infoUnpacker.get(), infoPrediffer.get(), nID, cmdInfo.m_nLineIndex);
}
else if (cmdInfo.m_Files.GetSize() > 1)
{
DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE};
bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, nullptr,
- infoUnpacker.get(), infoPrediffer.get(), cmdInfo.m_nLineIndex);
+ infoUnpacker.get(), infoPrediffer.get(), nID, cmdInfo.m_nLineIndex);
}
else if (cmdInfo.m_Files.GetSize() == 1)
{
{
strDesc[0] = cmdInfo.m_sLeftDesc;
strDesc[1] = cmdInfo.m_sRightDesc;
- bCompared = pMainFrame->DoSelfCompare(IDOK, sFilepath, strDesc, nullptr, cmdInfo.m_nLineIndex);
+ bCompared = pMainFrame->DoSelfCompare(nID, sFilepath, strDesc, nullptr, cmdInfo.m_nLineIndex);
}
else if (IsProjectFile(sFilepath))
{
DWORD dwFlags[3] = {cmdInfo.m_dwLeftFlags, cmdInfo.m_dwRightFlags, FFILEOPEN_NONE};
bCompared = pMainFrame->DoFileOpen(&cmdInfo.m_Files,
dwFlags, strDesc, cmdInfo.m_sReportFile, cmdInfo.m_bRecurse, nullptr,
- infoUnpacker.get(), infoPrediffer.get(), cmdInfo.m_nLineIndex);
+ infoUnpacker.get(), infoPrediffer.get(), nID, cmdInfo.m_nLineIndex);
}
}
else if (cmdInfo.m_Files.GetSize() == 0) // if there are no input args, we can check the display file dialog flag
*/
MergeCmdLineInfo::MergeCmdLineInfo(const TCHAR *q):
m_nCmdShow(SHOWNORMAL),
+ m_nWindowType(AUTOMATIC),
m_bEscShutdown(false),
m_bExitIfNoDiff(Disabled),
m_bRecurse(false),
// -f "mask" - file filter mask ("*.h *.cpp")
q = EatParam(q, m_sFileFilter);
}
+ else if (param == _T("t"))
+ {
+ // -t "type" - window type
+ q = EatParam(q, param);
+ param = strutils::makelower(param);
+ if (param == _T("automatic"))
+ m_nWindowType = WindowType::AUTOMATIC;
+ else if (param == _T("text"))
+ m_nWindowType = WindowType::TEXT;
+ else if (param == _T("table"))
+ m_nWindowType = WindowType::TABLE;
+ else if (param == _T("binary"))
+ m_nWindowType = WindowType::BINARY;
+ else if (param == _T("image"))
+ m_nWindowType = WindowType::IMAGE;
+ else
+ m_sErrorMessages.push_back(_T("Unknown window type '") + param + _T("' specified"));
+ }
else if (param == _T("m"))
{
// -m "method" - compare method
SIZE,
};
+ enum WindowType
+ {
+ AUTOMATIC,
+ TEXT,
+ TABLE,
+ BINARY,
+ IMAGE,
+ };
+
ShowWindowType m_nCmdShow; /**< Initial state of the application's window. */
+ WindowType m_nWindowType; /**< The type of window that displays the files to compare. */
bool m_bEscShutdown; /**< Pressing ESC will close the application */
ExitNoDiff m_bExitIfNoDiff; /**< Exit if files are identical. */