[
[
"optex - General purpose command option wrapper\n",
"optex - 汎用コマンドオプションラッパー\n"
],
[
"B<optex> I<command> [ B<-M>I<module> ] ...\n",
"B<optex> I<コマンド> [ B<-M>I<モジュール> ] ...\n"
],
[
"or I<command> -> B<optex> symlink, or\n",
"または I<コマンド> -> B<optex> シンボリックリンク、または\n"
],
[
"B<optex> I<options> [ -l | -m ] ...\n",
"B<optex> I<オプション> [ -l | -m ] ...\n"
],
[
"B<optex> is a general purpose command option handling wrapper utilizing Perl module L<Getopt::EX>. It enables user to define their own option aliases for any commands on the system, and provide module style extensibility.\n",
"B<optex>はPerlモジュールL<Getopt::EX>を利用した汎用コマンドオプション処理ラッパーです。ユーザーはシステム上の任意のコマンドに対して自分自身のオプションエイリアスを定義し、モジュールスタイルの拡張性を提供することができます。\n"
],
[
"Target command is given as an argument:\n",
"対象のコマンドは引数として与えられます:\n"
],
[
"or as a symbolic linked file to B<optex>:\n",
"またはB<optex>へのシンボリックリンクされたファイルとして:\n"
],
[
"If the configuration file F<~/.optex.d/>I<command>F<.rc> exists, it is evaluated before execution and command arguments are pre-processed using it.\n",
"設定ファイルF<~/.optex.d/>I<コマンド>F<.rc>が存在する場合、実行前に評価され、その設定を使用してコマンド引数が事前処理されます。\n"
],
[
"Think of macOS's C<date> command, which does not have C<-I[TIMESPEC]> option. Using B<optex>, these can be implemented by preparing following setting in F<~/.optex.d/date.rc> file.\n",
"macOSのC<date>コマンドを考えてみましょう。これにはC<-I[TIMESPEC]>オプションがありません。B<optex>を使用すると、F<~/.optex.d/date.rc>ファイルに次の設定を準備することで実装することができます。\n"
],
[
"Then next command will work as expected.\n",
"次のコマンドは期待通りに動作します。\n"
],
[
"If a symbolic link C<< date -> optex >> is found in command search path, you can use it just same as standard command, but with unsupported options.\n",
"コマンド検索パスにC<< date -> optex >>のシンボリックリンクが見つかった場合、標準コマンドと同じように使用できますが、サポートされていないオプションも使用できます。\n"
],
[
"Common configuration is stored in F<~/.optex.d/default.rc> file, and those rules are applied to all commands executed through B<optex>.\n",
"共通の設定はF<~/.optex.d/default.rc>ファイルに保存され、それらのルールはB<optex>を通じて実行されるすべてのコマンドに適用されます。\n"
],
[
"Actually, C<--iso-8601> option can be defined simpler as this:\n",
"実際には、C<--iso-8601>オプションはこのように単純に定義することができます:\n"
],
[
"This works fine almost always, but fails with sole C<--iso-8601> option preceding other option like this:\n",
"これはほとんどの場合うまく動作しますが、他のオプションの前に単独でC<--iso-8601>オプションがある場合には失敗します:\n"
],
[
"B<optex>'s command alias is no different from the alias function of shell, but it is effective in that it can be executed as a command from a tool or script, and can be managed collectively in a configuration file.\n",
"B<optex>のコマンドエイリアスはシェルのエイリアス機能と変わりませんが、ツールやスクリプトからコマンドとして実行できる点、設定ファイルで一括管理できる点が有効です。\n"
],
[
"Command aliases can be set in the configuration file (F<~/.optex.d/config.toml>) like this:\n",
"コマンドエイリアスは、設定ファイル(F<~/.optex.d/config.toml>)にこのように設定できます:\n"
],
[
"You can make symbolic link from C<tc> to C<optex> like this:\n",
"次のようにC<tc>からC<optex>へのシンボリックリンクを作成できます:\n"
],
[
"And include F<$HOME/.optex.d/bin> in your C<PATH> evnironment.\n",
"そして、F<$HOME/.optex.d/bin>をあなたのC<PATH>環境に含めます。\n"
],
[
"The C<textconv> module can be used to convert files given as arguments to plain text. Defined in this way, Word files can be compared as follows.\n",
"C<textconv>モジュールは、引数として与えられたファイルをプレーンテキストに変換するために使用できます。このように定義すると、Wordファイルは次のように比較できます。\n"
],
[
"Alias name is used to find rc file and module directory. In the above example, F<~/.optex.d/tc.rc> and F<~/.optex.d/tc/> will be referred.\n",
"エイリアス名はrcファイルとモジュールディレクトリを見つけるために使用されます。上記の例では、F<~/.optex.d/tc.rc>とF<~/.optex.d/tc/>が参照されます。\n"
],
[
"It is also possible to write shell scripts in the config file. The following example implements the C-shell C<repeat> command.\n",
"設定ファイルにシェルスクリプトを書くことも可能です。次の例は、CシェルのC<repeat>コマンドを実装しています。\n"
],
[
"Read L<CONFIGURATION FILE> section.\n",
"L<CONFIGURATION FILE>セクションを読んでください。\n"
],
[
"Complex string can be composed using macro C<define>. Next example is an awk script to count vowels in the text, to be declared in file F<~/.optex.d/awk.rc>.\n",
"マクロC<define>を使用して複雑な文字列を構成することができます。次の例は、テキスト内の母音を数えるawkスクリプトで、F<~/.optex.d/awk.rc>ファイルに宣言されます。\n"
],
[
"This can be used like this:\n",
"これは次のように使用できます:\n"
],
[
"When setting complex option, C<expand> directive is useful. C<expand> works almost same as C<option>, but effective only within the file scope, and not available for command line option.\n",
"複雑なオプションを設定する場合、C<expand>ディレクティブが便利です。C<expand>はC<option>とほぼ同じように動作しますが、ファイルスコープ内でのみ有効であり、コマンドラインオプションでは使用できません。\n"
],
[
"B<optex> also supports module extension. In the example of C<date>, module file is found at F<~/.optex.d/date/> directory. If default module, F<~/.optex.d/date/default.pm> exists, it is loaded automatically on every execution.\n",
"B<optex>はモジュール拡張もサポートしています。C<date>の例では、モジュールファイルはF<~/.optex.d/date/>ディレクトリにあります。デフォルトモジュールF<~/.optex.d/date/default.pm>が存在する場合、実行のたびに自動的にロードされます。\n"
],
[
"This is a normal Perl module, so package declaration and the final true value is necessary. Between them, you can put any kind of Perl code. For example, next program set environment variable C<LANG> to C<C> before executing C<date> command.\n",
"これは通常のPerlモジュールなので、パッケージ宣言と最後の真値が必要です。その間には、任意のPerlコードを入れることができます。例えば、次のプログラムはC<date>コマンドを実行する前に環境変数C<LANG>をC<C>に設定します。\n"
],
[
"Other modules are loaded using C<-M> option. Unlike other options, C<-M> have to be placed at the beginning of argument list. Module files in F<~/.optex.d/date/> directory are used only for C<date> command. If the module is placed on F<~/.optex.d/> directory, it can be used from all commands.\n",
"他のモジュールはC<-M>オプションを使用してロードされます。他のオプションとは異なり、C<-M>は引数リストの最初に置かなければなりません。F<~/.optex.d/date/>ディレクトリのモジュールファイルはC<date>コマンド専用です。モジュールがF<~/.optex.d/>ディレクトリに配置されている場合、すべてのコマンドから使用できます。\n"
],
[
"If you want use C<-Mes> module, make a file F<~/.optex.d/es.pm> with following content.\n",
"C<-Mes>モジュールを使用したい場合は、次の内容でF<~/.optex.d/es.pm>ファイルを作成します。\n"
],
[
"When the specified module was not found in library path, B<optex> ignores the option and stops argument processing immediately. Ignored options are passed through to the target command.\n",
"指定されたモジュールがライブラリパスに見つからない場合、B<optex>はオプションを無視し、直ちに引数処理を停止します。無視されたオプションは対象のコマンドにそのまま渡されます。\n"
],
[
"Module is also used with subroutine call. Suppose F<~/.optex.d/env.pm> module look like:\n",
"モジュールはサブルーチンコールと共に使用されます。例えば F<~/.optex.d/env.pm> モジュールは以下のようになります:\n"
],
[
"Then it can be used in more generic fashion. In the next example, first format is easy to read, but second one is more easy to type because it does not have special characters to be escaped.\n",
"それから、より一般的な方法で使用することができます。次の例では、最初のフォーマットは読みやすいですが、特殊文字をエスケープする必要がないため、2番目のものの方がタイプしやすいです。\n"
],
[
"Option aliases can be also declared in the module, at the end of file, following special literal C<__DATA__>. Using this, you can prepare multiple set of options for different purposes. Think about generic B<i18n> module:\n",
"オプションエイリアスもモジュールの最後に、特別なリテラル C<__DATA__> の後に宣言することができます。これを使用して、異なる目的のための複数のオプションセットを準備することができます。一般的な B<i18n> モジュールについて考えてみてください:\n"
],
[
"This can be used like:\n",
"これは以下のように使用することができます:\n"
],
[
"You can declare autoload module in your F<~/.optex.d/optex.rc> like:\n",
"F<~/.optex.d/optex.rc> にオートロードモジュールを宣言することができます:\n"
],
[
"Then you can use them without module option. In this case, option C<--ru> is replaced by C<-Mi18n --ru> automatically.\n",
"その後、モジュールオプションなしでそれらを使用することができます。この場合、オプション C<--ru> は自動的に C<-Mi18n --ru> に置き換えられます。\n"
],
[
"Module C<i18n> is implemented as L<Getopt::EX::i18n> and included in this distribution. So it can be used as above without additional installation.\n",
"モジュール C<i18n> は L<Getopt::EX::i18n> として実装されており、この配布に含まれています。したがって、追加のインストールなしで上記のように使用することができます。\n"
],
[
"Standard modules are installed at C<App::optex>, and they can be addressed with and without C<App::optex> prefix.\n",
"標準モジュールは C<App::optex> にインストールされており、C<App::optex> プレフィックスの有無にかかわらずアドレス指定することができます。\n"
],
[
"Print available option list. Option name is printed with substitution form, or help message if defined. Use B<-x> option to omit help message.\n",
"利用可能なオプションリストを表示します。オプション名は置換形式で印刷されるか、定義されていればヘルプメッセージが印刷されます。ヘルプメッセージを省略するには B<-x> オプションを使用します。\n"
],
[
"Option B<--man> or B<-h> will print document if available. Option B<-l> will print module path. Option B<-m> will show the module itself. When used after other modules, print information about the last declared module. Next command show the document about B<second> module.\n",
"オプション B<--man> または B<-h> は、利用可能であればドキュメントを印刷します。オプション B<-l> はモジュールパスを印刷します。オプション B<-m> はモジュール自体を表示します。他のモジュールの後に使用された場合、最後に宣言されたモジュールについての情報を印刷します。次のコマンドは B<second> モジュールについてのドキュメントを表示します。\n"
],
[
"Print debug messages.\n",
"デバッグメッセージを印刷します。\n"
],
[
"Module to manipulate command argument. See L<App::optex::util::argv> for detail.\n",
"コマンド引数を操作するモジュール。詳細については L<App::optex::util::argv> を参照してください。\n"
],
[
"Module to implement command input/output filters. See L<App::optex::util::filter> for detail.\n",
"コマンド入出力フィルタを実装するモジュール。詳細については L<App::optex::util::filter> を参照してください。\n"
],
[
"In addition to its own modules, B<optex> can also use C<Getopt::EX> modules. The standard C<Getopt::EX> modules installed are these.\n",
"独自のモジュールに加えて、B<optex> は C<Getopt::EX> モジュールも使用することができます。インストールされている標準の C<Getopt::EX> モジュールはこれらです。\n"
],
[
"You can display a Greek calendar by doing the following:\n",
"以下の手順でギリシャ暦を表示することができます:\n"
],
[
"These options are not effective when B<optex> was executed from symbolic link.\n",
"これらのオプションは、B<optex> がシンボリックリンクから実行された場合には効果がありません。\n"
],
[
"Create symbolic link in F<~/.optex.d/bin> directory.\n",
"F<~/.optex.d/bin> ディレクトリにシンボリックリンクを作成します。\n"
],
[
"Remove symbolic link in F<~/.optex.d/bin> directory.\n",
"F<~/.optex.d/bin> ディレクトリのシンボリックリンクを削除します。\n"
],
[
"List symbolic link files in F<~/.optex.d/bin> directory.\n",
"F<~/.optex.d/bin> ディレクトリのシンボリックリンクファイルをリストします。\n"
],
[
"List rc files in F<~/.optex.d> directory.\n",
"F<~/.optex.d> ディレクトリの rc ファイルをリストします。\n"
],
[
"Stop option manipulation. Use full pathname otherwise.\n",
"オプション操作を停止します。それ以外の場合は完全なパス名を使用してください。\n"
],
[
"B<optex> deals with module option (-M) on target command by default. However, there is a command which also uses same option for own purpose. Option B<--nomodule> disables that behavior. Other option interpretation is still effective, and there is no problem using module option in rc or module files.\n",
"B<optex> はデフォルトで対象コマンドのモジュールオプション (-M) を扱います。しかし、同じオプションを独自の目的で使用するコマンドもあります。オプション B<--nomodule> はその動作を無効にします。他のオプション解釈はまだ有効であり、rc ファイルやモジュールファイルでモジュールオプションを使用することに問題はありません。\n"
],
[
"Usually B<optex> exits with status of executed command. This option override it and force to exit with specified status code.\n",
"通常 B<optex> は実行されたコマンドのステータスで終了します。このオプションはそれをオーバーライドし、指定されたステータスコードで強制終了します。\n"
],
[
"When starting up, B<optex> reads configuration file F<~/.optex.d/config.toml> which is supposed to be written in TOML format.\n",
"起動時に、B<optex> は TOML 形式で書かれることを想定している設定ファイル F<~/.optex.d/config.toml> を読み込みます。\n"
],
[
"Set commands for which B<optex> does not interpret module option B<-M>. If the target command is found in this list, it is executed as if option B<--no-module> is given to B<optex>.\n",
"B<optex> がモジュールオプション B<-M> を解釈しないコマンドを設定します。対象コマンドがこのリストに見つかった場合、B<optex> にオプション B<--no-module> が与えられたかのように実行されます。\n"
],
[
"Set command aliases. Example:\n",
"コマンドエイリアスを設定します。例:\n"
],
[
"Command alias can be invoked either from symbolic link and command argument.\n",
"コマンドエイリアスは、シンボリックリンクとコマンド引数のいずれからも呼び出すことができます。\n"
],
[
"System module directory.\n",
"システムモジュールディレクトリ。\n"
],
[
"Personal root directory.\n",
"個人のルートディレクトリ。\n"
],
[
"Configuration file.\n",
"設定ファイル。\n"
],
[
"Common startup file.\n",
"共通のスタートアップファイル。\n"
],
[
"Startup file for I<command>.\n",
"I<コマンド>用のスタートアップファイル。\n"
],
[
"Module directory for I<command>.\n",
"I<コマンド>用のモジュールディレクトリ。\n"
],
[
"Default module for I<command>.\n",
"I<コマンド>のデフォルトモジュール。\n"
],
[
"Default directory to store symbolic links.\n",
"シンボリックリンクを保存するデフォルトディレクトリ。\n"
],
[
"This is not necessary, but it seems a good idea to make special directory to contain symbolic links for B<optex>, placing it in your command search path. Then you can easily add/remove it from the path, or create/remove symbolic links.\n",
"これは必須ではありませんが、B<optex>用のシンボリックリンクを含む特別なディレクトリを作成し、コマンド検索パスに配置すると良いと思われます。そうすることで、パスの追加/削除やシンボリックリンクの作成/削除を簡単に行うことができます。\n"
],
[
"Override default root directory F<~/.optex.d>.\n",
"デフォルトのルートディレクトリF<~/.optex.d>を上書きします。\n"
],
[
"Override default configuration file F<OPTEX_ROOT/config.toml>.\n",
"デフォルトの設定ファイルF<OPTEX_ROOT/config.toml>を上書きします。\n"
],
[
"Set module paths separated by colon (C<:>). These are inserted before standard path.\n",
"コロン(C<:>)で区切られたモジュールパスを設定します。これらは標準パスの前に挿入されます。\n"
],
[
"Override default symbolic link directory F<OPTEX_ROOT/bin>.\n",
"デフォルトのシンボリックリンクディレクトリF<OPTEX_ROOT/bin>を上書きします。\n"
]
]