<?xml version="1.0" encoding="UTF-8"?>
<sect1 id="CommandLine">
  <title><indexterm>
      <primary>コマンドライン</primary>
    </indexterm>コマンドライン</title>

  <para>WinMerge accepts several parameters from command line, in addition to
  paths to compare. Most of these parameters are intended for using WinMerge
  as an external compare application. Or for starting from batch files.</para>

  <para>コマンドラインシンタックス:</para>

  <para><cmdsynopsis sepchar=" ">
      <command moreinfo="none">WinMerge</command>

      <arg choice="opt" rep="norepeat"><option>/r</option></arg>

      <arg choice="opt" rep="norepeat"><option>/e</option></arg>

      <arg choice="opt" rep="norepeat"><option>/f</option>
      <replaceable>filter</replaceable></arg>

      <arg><option>/x</option></arg>

      <arg><option>/s</option></arg>

      <arg choice="opt" rep="norepeat"><option>/ul</option></arg>

      <arg choice="opt" rep="norepeat"><option>/ur</option></arg>

      <arg choice="opt" rep="norepeat"><option>/um</option></arg>
      <arg choice="opt" rep="norepeat"><option>/ub</option></arg>

      <arg choice="opt" rep="norepeat"><option>/wl</option></arg>

      <arg choice="opt" rep="norepeat"><option>/wr</option></arg>

      <arg choice="opt" rep="norepeat"><option>/wm</option></arg>

      <arg><option>/minimize</option></arg>

      <arg><option>/maximize</option></arg>

      <arg choice="opt" rep="norepeat"><option>/dl</option>
      <replaceable>leftdesc</replaceable></arg>

      <arg choice="opt" rep="norepeat"><option>/dr</option>
      <replaceable>rightdesc</replaceable></arg>

      <arg choice="plain"
      rep="norepeat"><replaceable>leftpath</replaceable></arg>

      <arg choice="plain"
      rep="norepeat"><replaceable>rightpath</replaceable></arg>

      <arg choice="opt"
      rep="norepeat"><replaceable>outputpath</replaceable></arg>
    </cmdsynopsis></para>

  <para>All parameters start with "/" or with "-" prefix character. Pathnames
  don't have any prefix character.</para>

  <itemizedlist>
    <listitem>
      <simpara><option>/?</option> このヘルプを表示します。</simpara>
    </listitem>

    <listitem>
      <simpara><option>/r</option> 再帰的にディレクトリを比較します。
      Normally WinMerge does not compare subfolder contents but
      does the "flat" compare showing the files in compared folders and
      subfolders as separate items. Using /r tells WinMerge to compare all
      files in all subfolders. When subfolders are included, only unique
      subfolders are visible as separate items in compare results. Note that
      including subfolders can increase compare time remarkably.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/e</option> <keycap>Esc</keycap>キーの押下でWinMergeを終了します。
      This is useful when using WinMerge as an
      external compare application. WinMerge can act like an dialog which is
      easy and fast to close.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/f</option>
      使用するフィルタを指定します。フィルタは、"<filename>*.h
      *.cpp</filename>"のようなファイルマスクや、"<literal>XML/HTML
      Devel</literal>"のようなファイルフィルタ名が指定できます。引用符はフィルタ名等にスペースが含まれる場合に必要となります。</simpara>
    </listitem>

    <listitem>
      <simpara><option>/x</option> ファイルが同一の場合、情報ダイアログ表示後、WinMergeを終了します。 This parameter is useful
      when WinMerge is used as an external compare application. It helps to
      faster process and/or ignore files which don't have any differences.
      Note that this option does not apply when files become identical when
      merging/editing them.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/s</option>
      シングルインスタンスモードを有効にします。もし、すでにWinMergeが起動している場合、起動しているWinMergeで比較を行います。
      Depending on other settings (if multiple windows are allowed) new
      compare is opened to existing or new window.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/ul</option> 左側パスをMRUに追加しません。 External applications should not add paths to Open-dialog's MRU
      lists.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/ur</option> 右側パスをMRUに追加しません。
      External applications should not add paths to Open-dialog's MRU
      lists.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/um</option> 中央パスをMRUに追加しません。
      External applications should not add paths to Open-dialog's MRU
      lists.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/ub</option> 両方のパスをMRUに追加しません。
      External applications should not add paths to Open-dialog's MRU
      lists.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/wl</option> 左側を読み取り専用で開きます。
      Use this when you don't want to change left-side items in
      compare.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/wr</option> 右側を読み取り専用で開きます。
      Use this when you don't want to change right-side items in
      compare.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/wm</option> 中央を読み取り専用で開きます。
      Use this when you don't want to change middle items in
      compare.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/minimize</option> WinMergeを最小化で起動します。 This
      option can be used to start WinMerge minimized for lengthy
      compares.</simpara>
    </listitem>

    <listitem>
      <simpara><option>/maximize</option> WinMergeを最大化で起動します。
      </simpara>
    </listitem>

    <listitem>
      <simpara><option>/dl</option> ディレクトリ/ファイル名の代わりに説明文を左側に表示します。
 This allows showing version number or
      label for compared items. Like "Version 1.0" or "Work Copy".</simpara>
    </listitem>

    <listitem>
      <simpara><option>/dr</option> or <option>-dr</option> 
      ディレクトリ/ファイル名の代わりに説明文を右側に表示します。
      This allows showing version number or
      label for compared items. Like "Version 1.0" or "Work Copy".</simpara>
    </listitem>

    <listitem>
      <simpara><replaceable>leftpath</replaceable> 
      は、左側で開くディレクトリまたはファイル名です</simpara>
    </listitem>

    <listitem>
      <simpara><replaceable>rightpath</replaceable> 
      は、右側で開くディレクトリまたはファイル名です</simpara>
    </listitem>

    <listitem>
      <simpara><replaceable>outputpath</replaceable> 
      は、省略可能な、マージされたファイルの保存先ディレクトリです</simpara>
    </listitem>
  </itemizedlist>

  <para><tip>
      <para>WinMerge accepts filename and folder name as path parameters, as
      long as the given folder contains file with same name than in first
      parameter.</para>

      <para>For example, one can give a command: WinMerge
      <filename>C:\Folder\File.txt</filename> <filename
      class="directory">C:\Folder2</filename>. If <filename
      class="directory">C:\Folder2</filename> contains file named
      <filename>File.txt</filename> WinMerge now compares files
      <filename>C:\Folder\File.txt</filename> and C:\Folder2\File.txt</para>
    </tip>Usually WinMerge requires that both path parameters
  (<replaceable>leftpath</replaceable> and
  <replaceable>rightpath</replaceable>) point to folders or files. It is not
  possible to compare folder to file (except in case described in above note).
  If WinMerge cannot find any of given paths, it opens Open-dialog.</para>

  <para>Third path given in command line is rarely needed when WinMerge is
  started from command line. It is meant to be used with many version control
  tools which use third path as a "<emphasis>result</emphasis>" file. WinMerge
  always shows two files in file compare, the third path is a path where any
  of these files gets saved into, leaving other two paths intact.</para>

  <para>Usually these tools use terms like "<emphasis>theirs</emphasis>",
  "<emphasis>mine</emphasis>" and "<emphasis>merged</emphasis> "/ "
  <emphasis>resolved</emphasis>" about these three files. And those paths
  should be given in that order for WinMerge.</para>

  <sect2>
    <title>コンフリクトファイル</title>

    <para>Conflict file can be given to command line as one path to the
    conflict file. There cannot be second or third path with conflict file.
    After WinMerge opens the given conflict file, it can be resolved like
    described in <link linkend="ResolveConflictFiles">Resolving Conflict
    Files</link>.</para>
  </sect2>
</sect1>
