Skip to content

Commit 961c977

Browse files
committed
Merge upstream with conflict
2 parents fb7aa31 + 35ab5d1 commit 961c977

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

content/_index.md

+54-2
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ _参考文献: [The Anti-Mac User Interface (Don Gentner and Jakob Nielsen)](htt
275275
* Julia: [ArgParse.jl](https://github.com/carlobaldassi/ArgParse.jl), [Comonicon.jl](https://github.com/comonicon/Comonicon.jl)
276276
* Kotlin: [clikt](https://ajalt.github.io/clikt/)
277277
* Node: [oclif](https://oclif.io/)
278-
* Deno: [flags](https://deno.land/std/flags)
278+
* Deno: [parseArgs](https://jsr.io/@std/cli/doc/parse-args/~/parseArgs)
279279
* Perl: [Getopt::Long](https://metacpan.org/pod/Getopt::Long)
280280
* PHP: [console](https://github.com/symfony/console), [CLImate](https://climate.thephpleague.com)
281281
* Python: [Argparse](https://docs.python.org/3/library/argparse.html), [Click](https://click.palletsprojects.com/), [Typer](https://github.com/tiangolo/typer)
282282
* Ruby: [TTY](https://ttytoolkit.org/)
283-
* Rust: [clap](https://clap.rs/)
283+
* Rust: [clap](https://docs.rs/clap)
284284
* Swift: [swift-argument-parser](https://github.com/apple/swift-argument-parser)
285285

286286
**成功時は終了コードゼロ、失敗時には非ゼロを返してください。**
@@ -299,9 +299,17 @@ _参考文献: [The Anti-Mac User Interface (Don Gentner and Jakob Nielsen)](htt
299299

300300
**なにもオプションを指定しなかった時、`-h``--help`フラグが指定された時にはヘルプテキストを表示してください。**
301301

302+
<<<<<<< HEAD
302303
**デフォルトでは簡潔なヘルプテキストを出力するようにしてください。**
303304
可能なら、`myapp``myapp subcommand`が実行された時はデフォルトでヘルプテキストを表示するようにしてください。
304305
プログラムが非常にシンプルで明らかなデフォルトの動作があるとき (例: `ls`) や、プログラムが入力をインタラクティブに受け取る時 (例: `cat`) はその限りではありません。
306+
=======
307+
**Display a concise help text by default.**
308+
When `myapp` or `myapp subcommand` is run with no arguments, display help text.
309+
310+
You can ignore this guideline if your program or subcommand is very simple and requires no arguments (e.g. `ls`, `git pull`),
311+
or if it's interactive by default (e.g. `npm init`).
312+
>>>>>>> upstream/main
305313
306314
簡潔なヘルプテキストは以下のもののみを含むべきです。
307315

@@ -543,8 +551,13 @@ _TTYが何かについては[参考文献を読んでください。](https://un
543551
このテキストストリームは通常スクリプトを書くために使われますが、プログラムを使う人間のユーザビリティにも役立ちます。
544552
たとえば、`grep`に出力を流して期待する出力を得ることがあります。
545553

554+
<<<<<<< HEAD
546555
> “すべてのプログラムの出力は、未知のものも含めた他のプログラムの入力となることを期待する。”
547556
[Doug McIlroy](https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html)
557+
=======
558+
> “Expect the output of every program to become the input to another, as yet unknown, program.”
559+
[Doug McIlroy](http://web.archive.org/web/20220609080931/https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html)
560+
>>>>>>> upstream/main
548561
549562
**人間可読な出力が機械可読な出力を壊す場合、`--plain`で出力を平易な、`grep``awk`のようなツールと統合できる表形式のテキストフォーマットにするようにしてください。**
550563
場合によっては、人間にとって読みやすいのとは異なる方法で出力を行う必要があるかもしれません。
@@ -638,12 +651,21 @@ drwxr-xr-x 2 root root 4.0K Jul 20 14:57 skel
638651
**プログラムがターミナルで動作していない、もしくはユーザが無効化するよう要請した時は、色を無効化してください。**
639652
以下のようなもので色を無効化できるべきです。
640653

654+
<<<<<<< HEAD
641655
- `stdout``stderr`がインタラクティブなターミナル (TTY) ではない。
642656
この2つは個別にチェックするのが最良です。`stdout`を他のプログラムにパイプ接続しているときでも、`stderr`に色がついていると便利です。
643657
- `NO_COLOR`環境変数が設定されている。
644658
- `TERM`環境変数の値が`dumb`である。
645659
- ユーザが`--no-color`オプションを渡した。
646660
- 特にあなたのプログラムだけ色を無効化したいという場合は`MYAPP_NO_COLOR`環境変数を追加したくなるかもしれません。
661+
=======
662+
- `stdout` or `stderr` is not an interactive terminal (a TTY).
663+
It’s best to individually check—if you’re piping `stdout` to another program, it’s still useful to get colors on `stderr`.
664+
- The `NO_COLOR` environment variable is set and it is not empty (regardless of its value).
665+
- The `TERM` environment variable has the value `dumb`.
666+
- The user passes the option `--no-color`.
667+
- You may also want to add a `MYAPP_NO_COLOR` environment variable in case users want to disable color specifically for your program.
668+
>>>>>>> upstream/main
647669
648670
_参考文献: [no-color.org](https://no-color.org/), [12 Factor CLI Apps](https://medium.com/@jdxcode/12-factor-cli-apps-dd3c227a0e46)_
649671

@@ -685,10 +707,17 @@ UwlHnUFXgENO3ifPZd8zoSKMxESxxot4tMgvfXjmRp5G3BGrAnonncE7Aj11pn3SSYgEcrrn2sMyLGpV
685707
**少なくともデフォルトでは`stderr`をログファイルのように扱わないでください。**
686708
verboseモードでない時にログレベルのラベル (`ERR``WARN`等) や関連性の薄い情報を出力しないでください。
687709

710+
<<<<<<< HEAD
688711
**大量のテキストを出力する時はページャ (例: `less`) を使ってください。**
689712
たとえば、`git diff`はデフォルトでこれを行います。
690713
ページャの使用は問題を起こしやすいので、ユーザの体験を損なわないように実装には気をつけてください。
691714
`stdin``stdout`がインタラクティブなターミナルでないならページャを使うべきではありません。
715+
=======
716+
**Use a pager (e.g. `less`) if you are outputting a lot of text.**
717+
For example, `git diff` does this by default.
718+
Using a pager can be error-prone, so be careful with your implementation such that you don’t make the experience worse for the user.
719+
Use a pager only if `stdin` or `stdout` is an interactive terminal.
720+
>>>>>>> upstream/main
692721
693722
`less`に対する優れたオプション指定は`less -FIRX`です。
694723
これによってコンテンツがスクリーンに収まる場合は動作せず、検索の際に大文字・小文字を無視し、色と書式を有効化し、`less`が終了した時に画面にコンテンツを残すようになります。
@@ -845,6 +874,7 @@ unknown flag: --foo
845874
これはユーザを混乱させるかもしれません。コマンドの使用においてそのような混乱が起こる最も一般的な動作は、上キーを押して直近の呼び出しを取り出して、末尾にオプションを追加してまた実行するような場面です。
846875
可能ならば、引数パーサの制約にぶつかったとしても、どちらの形式も等価であるようにしてください。
847876

877+
<<<<<<< HEAD
848878
**シークレットをフラグから直接読まないでください。**
849879
`--password`のような形でコマンドがシークレットを受け取るとき、引数の値は`ps`の出力や場合によりシェルの履歴等から漏洩します。
850880
さらに、この手のフラグはシークレットに対するセキュアでない環境変数の使用を招きます。
@@ -855,6 +885,20 @@ unknown flag: --foo
855885
(Bashでは`--password $(< password.txt)`のようにファイルの内容を渡すことが可能です。
856886
このアプローチは`ps`の出力によってファイルの中身が漏洩する同じようなセキュリティリスクがあります。
857887
避けるべきです。)
888+
=======
889+
**Do not read secrets directly from flags.**
890+
When a command accepts a secret, e.g. via a `--password` flag,
891+
the flag value will leak the secret into `ps` output and potentially shell history.
892+
And, this sort of flag encourages the use of insecure environment variables for secrets.
893+
(Environment variables are insecure because they can often be read by other users, their values end up in debug logs, etc.)
894+
895+
Consider accepting sensitive data only via files, e.g. with a `--password-file` flag, or via `stdin`.
896+
A `--password-file` flag allows a secret to be passed in discreetly, in a wide variety of contexts.
897+
898+
(It’s possible to pass a file’s contents into a flag in Bash by using `--password $(< password.txt)`.
899+
This approach has the same security as mentioned above.
900+
It’s best avoided.)
901+
>>>>>>> upstream/main
858902
859903
### インタラクティブ性 {#interactivity}
860904

@@ -1091,11 +1135,19 @@ XDGベースディレクトリ仕様
10911135
**設定パラメータを優先順位に従って適用してください。**
10921136
以下は設定パラメータの優先順位を高いものから順に並べたものです。
10931137

1138+
<<<<<<< HEAD
10941139
- フラグ
10951140
- 実行中のシェルの環境変数
10961141
- プロジェクトレベルの設定 (例: `.env`)
10971142
- ユーザレベル設定
10981143
- システムレベル設定
1144+
=======
1145+
- Flags
1146+
- The running shell’s environment variables
1147+
- Project-level configuration (e.g. `.env`)
1148+
- User-level configuration
1149+
- System wide configuration
1150+
>>>>>>> upstream/main
10991151
11001152
### 環境変数 {#environment-variables}
11011153

0 commit comments

Comments
 (0)