Add help contents for command-line tool (close #282)

This commit is contained in:
1024jp 2014-12-27 07:54:03 +01:00
parent 87c6b48a83
commit b005fda61d
14 changed files with 249 additions and 2 deletions

View File

@ -7,8 +7,7 @@ Change Log
### New Features
- `cot` command-line tool. (WIP)
- TODO: help content
- `cot` command-line tool.
- New AppleScript property `tab width` for document object.
- Now, CotEditor script receives the absolute file path of the frontmost document as an argument if available.
- Add “New CotEditor Document with Selection” and “Open File in CotEditor” Services.

View File

@ -72,6 +72,9 @@ pre {
border-radius: 3px;
clear: both;
}
pre {
padding: 0.4em 1.0em;
}
ul {
list-style-type: square;

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="keywords" content="cot, command"/>
<link rel="start" href="../CotEditorHelp.html"/>
<link rel="index" href="../xpgs/xall.html"/>
<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
<title>cot command</title>
</head>
<body>
<h1><code>cot</code> command</h1>
<p>CotEditor has '<strong><code>cot</code></strong>' command-line tool which allows you to control CotEditor from the command-line. To use '<code>cot</code>' command, install it at first.</p>
<h2>Installation</h2>
<p>The '<code>cot</code>' command-line tool can be easily installed at '/usr/local/bin/cot' from the <a href="../pgs/pref_integration.html">Integration pane</a> in CotEditor's Preferences.</p>
<p>You can also install it to a desired location creating a symbolic link via Terminal.</p>
<pre><code>ln -s /Applications/CotEditor.app/Contents/MacOS/cot ~/bin/cot</code></pre>
<h2>Options</h2>
<p>The following options can be used on <code>cot</code> command.</p>
<table>
<tr><th><code>-l</code>, <code>--line</code> <code>&lt;line&gt;</code></th><td>Jump to specific line in opened document. <code>&lt;line&gt;</code> is an integer specifying the number of line.</td></tr>
<tr><th><code>-c</code>, <code>--column</code> <code>&lt;column&gt;</code></th><td>Jump to specific column in opened document. <code>&lt;column&gt;</code> is an integer specifying the number of column.</td></td></tr>
<tr><th><code>-b</code>, <code>--background</code></th><td>Do not bring the application to the foreground.</td></tr>
<tr><th><code>-h</code>, <code>--help</code></th><td>Show help.</td></tr>
<tr><th><code>-v</code>, <code>--version</code></th><td>Print version information.</td></tr>
</table>
<h2>Examples</h2>
<p>A simple <code>cot</code> command will launch CotEditor, or just acivate it if CotEditor is already running.</p>
<pre><code>cot
</code></pre>
<p>The following command opens the foo.txt file on CotEditor and scroll to the line 200 in the opened document. <code>cot</code> command do nothing if foo.txt file is not exists.</p>
<pre><code>cot --line 200 foo.txt
</code></pre>
<p>You can also pipe a text. CotEditor will open a new document with the piped text.</p>
<pre><code>echo &quot;I am a dog but also a cow at the same time.&quot; | cot
</code></pre>
<section id="cf">
<h2>See also</h2>
<ul>
<li><a href="../pgs/pref_integration.html">Integration preferences</a></li>
</ul>
</section>
</body>
</html>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="keywords" content="Integration preferences, command, terminal"/>
<link rel="start" href="../CotEditorHelp.html"/>
<link rel="index" href="../xpgs/xall.html"/>
<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
<title>Integration preferences</title>
</head>
<body>
<a name="pref_integration"></a>
<h1>Integration preferences</h1>
<p>The Integration pane let you to set CotEditor's behavior with other softwares.</p>
<dl>
<dt>Command-line tool</dt>
<dd>Install or uninstall '<code>cot</code>' command-line tool.<br/>
On installation, a symbolic link targeting to 'cot' executable in CotEditor.app package will be created at '/usr/local/bin/cot'.</dd>
</dl>
<section id="cf">
<h2>See also</h2>
<ul>
<li><a href="../pgs/about_cot.html">cot command</a></li>
<li><a href="../xpgs/xpreferences.html">preferences</a></li>
</ul>
</section>
</body>
</html>

View File

@ -17,6 +17,7 @@
<ul>
<li><a href="./xsoftware.html">About CotEditor</a></li>
<li><a href="./xcommandline.html">Command-line tool</a></li>
<li><a href="./xcustomize.html">Customizing</a></li>
<li><a href="./xfiledrop.html">File drop</a></li>
<li><a href="./xoutlinemenu.html">Outline menu</a></li>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html lang="en" xml:lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="robots" content="anchors"/>
<link rel="start" href="../CotEditorHelp.html"/>
<link rel="index" href="../xpgs/xall.html"/>
<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
<link rel="stylesheet" href="../../Shared/sty/index.css"/>
<title>Command-line tool</title>
</head>
<body>
<h1>Command-line tool</h1>
<ul>
<li><a href="../pgs/about_cot.html">cot command</a></li>
<li><a href="../pgs/pref_integration.html">Integration preferences</a></li>
</ul>
</body>
</html>

View File

@ -24,6 +24,7 @@
<li><a href="../pgs/pref_filedrop.html">File Drop preferences</a></li>
<li><a href="../pgs/pref_keybindings.html">Key Bindings preferences</a></li>
<li><a href="../pgs/pref_print.html">Print preferences</a></li>
<li><a href="../pgs/pref_integration.html">Integration preferences</a></li>
</ul>
</body>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html lang="ja" xml:lang="ja">
<head>
<meta charset="UTF-8"/>
<meta name="keywords" content="cot, コマンド"/>
<link rel="start" href="../CotEditorHelp.html"/>
<link rel="index" href="../xpgs/xall.html"/>
<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
<title>cot コマンド</title>
</head>
<body>
<h1><code>cot</code> コマンド</h1>
<p>CotEditor にはコマンドラインからの操作を可能にする <code>cot</code> コマンドラインツールがあります。<code>cot</code> コマンドを使うためには、まずインストールをしてください。</p>
<h2>インストール</h2>
<p>'<code>cot</code>' コマンドラインツールは CotEditor 環境設定の<a href="../pgs/pref_integration.html">連携</a>から、簡単に '/usr/local/bin/cot' にインストールできます。</p>
<p>Terminal からシンボリックリンクを作成して、任意の箇所にインストールすることも可能です。</p>
<pre><code>ln -s /Applications/CotEditor.app/Contents/MacOS/cot ~/bin/cot</code></pre>
<h2>オプション</h2>
<p><code>cot</code> コマンドは以下のオプションが使用できます。</p>
<table>
<tr><th><code>-l</code>, <code>--line</code> <code>&lt;line&gt;</code></th><td>開いた書類の指定した行に移動します。 <code>&lt;line&gt;</code> は行を指定する整数型です。</td></tr>
<tr><th><code>-c</code>, <code>--column</code> <code>&lt;column&gt;</code></th><td>開いた書類の指定した列に移動します。 <code>&lt;column&gt;</code> は列を指定する整数型です。</td></td></tr>
<tr><th><code>-b</code>, <code>--background</code></th><td>アプリケーションをバックグラウンドで開きます。</td></tr>
<tr><th><code>-h</code>, <code>--help</code></th><td>ヘルプを表示します。</td></tr>
<tr><th><code>-v</code>, <code>--version</code></th><td>バージョンを表示します。</td></tr>
</table>
<h2></h2>
<p><code>cot</code> コマンド単体で CotEditor が起動します。</p>
<pre><code>cot
</code></pre>
<p>以下のコマンドは、foo.txt ファイルを CotEditor で開き 200 行目にスクロールします。もし foo.txt ファイルが存在しない場合は、<code>cot</code> コマンドは何も行いません。</p>
<pre><code>cot --line 200 foo.txt
</code></pre>
<p>文字列をパイプで渡すこともできます。CotEditor は渡された文字列を新規書類として開きます。</p>
<pre><code>echo &quot;I am a dog but also a cow at the same time.&quot; | cot
</code></pre>
<section id="cf">
<h2>関連項目</h2>
<ul>
<li><a href="../pgs/pref_integration.html">環境設定:連携</a></li>
</ul>
</section>
</body>
</html>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html lang="ja" xml:lang="ja">
<head>
<meta charset="UTF-8"/>
<meta name="keywords" content="「連携」環境設定, 連携環境設定, 連携, コマンドライン, ターミナル, terminal"/>
<link rel="start" href="../CotEditorHelp.html"/>
<link rel="index" href="../xpgs/xall.html"/>
<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
<title>環境設定:連携</title>
</head>
<body>
<a name="pref_integration"></a>
<h1>環境設定:連携</h1>
<p>コマンドラインツールなど他のソフトウェアとの連携を設定します。</p>
<dl>
<dt>コマンドラインツール</dt>
<dd>コマンドラインツール <code>cot</code> をインストールまたはアンインストールします。<br/>
インストールをすると、 '/usr/local/bin/cot' に CotEditor.app パッケージ内の cot 実行ファイルへのシンボリックリンクが作成されます。</dd>
</dl>
<section id="cf">
<h2>関連項目</h2>
<ul>
<li><a href="../pgs/about_cot.html">cot コマンド</a></li>
<li><a href="../xpgs/xpreferences.html">環境設定</a></li>
</ul>
</section>
</body>
</html>

View File

@ -26,6 +26,7 @@
<li><a href="./xfiledrop.html">ファイルドロップ</a></li>
<li><a href="./xprint.html">プリント</a></li>
<li><a href="./xencoding.html">文字エンコーディング</a></li>
<li><a href="./xcommandline.html">コマンドラインツール</a></li>
<li><a href="./xcustomize.html">カスタマイズする</a></li>
<li><a href="./xconfiguration.html">設定する</a></li>
<li><a href="./xfaq.html">問題を解決する</a></li>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html lang="ja" xml:lang="ja">
<head>
<meta charset="UTF-8"/>
<meta name="robots" content="anchors"/>
<link rel="start" href="../CotEditorHelp.html"/>
<link rel="index" href="../xpgs/xall.html"/>
<link rel="stylesheet" href="../../Shared/sty/standard.css"/>
<link rel="stylesheet" href="../../Shared/sty/index.css"/>
<title>コマンドラインツール</title>
</head>
<body>
<h1>コマンドラインツール</h1>
<ul>
<li><a href="../pgs/about_cot.html">cot コマンド</a></li>
<li><a href="../pgs/pref_integration.html">環境設定:連携</a></li>
</ul>
</body>
</html>

View File

@ -24,6 +24,7 @@
<li><a href="../pgs/pref_filedrop.html">ファイルドロップ</a></li>
<li><a href="../pgs/pref_keybindings.html">キーバインド</a></li>
<li><a href="../pgs/pref_print.html">プリント</a></li>
<li><a href="../pgs/pref_integration.html">連携</a></li>
</ul>
</body>