Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

CLI

Ruby | CLI | Be Helpful | Documenting Options

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 各フラグ、スイッチに1センテンスの短い要約を記述します。 端末で折り返さない程度の長さにします。(60文字以内)フラグが引数をとる場合は、短い単語で記述する。 (もし…

Ruby | CLI | Be Helpful | Documenting an App's Description and Invocation Syntax

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 ユーザーが最初に期待するのは1行の要約を記した banner を見ることです。 コマンドを持たないシンプルなアプリケーション 典型的なフォーマットは下記のようになります exe…

Ruby | CLI | Be Helpful | Writing Good Help Text and Documentation

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 ヘルプテキストや明確で、簡潔で、正確で、便利なドキュメントは重要。 ヘルプや、ドキュメントにはいくつかの決まりごとがある。1センテンスにまとめられた概要である bann…

Ruby | CLI | Be Helpful | Documenting a Command Suit

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 Command suit は各コマンドごとのドキュメントが必要になる。 これは2段階のヘルプシステムで提供する。まず、1段階目として command -h で、globalなオプション・コマンド…

Ruby | CLI | Be Helpful | Adding a Brief Description for a CLI Apps

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 CLIアプリケーションをどういった目的に利用するのか、ヘルプに含めること。例として ls コマンドの日本語ヘルプを見てみます。 $ ls --help 使用法: ls [オプション]... […

Ruby | CLI | Be Helpful | Documenting a Command-Line Arguments

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 引数の情報を OptionParser の bannar に追加してみます。 下記記事のサンプルをベースに設定を追加します。Ruby | CLI | Be Easy to Use | Ruby | CLI | Be Easy to Use | …

Ruby | CLI | Be Helpful | Documenting a Command-Line Interface

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Helpful 詳細 コマンドラインの経験のあるユーザーは、コマンドラインをどう使うか知るために 次のことを試します。彼らは引数なしでコマンドを実行するか、 help スイッチを呼び出す。(…

Ruby | CLI | Be Easy to Use | Thorを利用した使いやすいCommand suitインターフェース

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Easy to Use 詳細 「OptionParserを利用した使いやすいCLIインターフェース(http://d.hatena.ne.jp/tbpg/20140526/1401109608)」で紹介したOptionParserは シンプルなCLIツールを作るには…

Ruby | CLI | Be Easy to Use | OptionParserを利用した使いやすいCLIインターフェース

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Easy to Use 詳細 ほとんどのCLIアプリケーションは慣習に従って作られている。 慣習に従っておけばユーザーにとって覚えるのが簡単なツールになる。 そこで、慣習に従ったCLIを作る助力…

Ruby | CLI | Be Easy to Use | CommandLineを理解する | Commands

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Easy to Use | CommandLineを理解する 詳細 CommandLineの構成要素を理解する | Commands Commands シンプルなコマンドラインアプリケーションは Options と Arguments だけで済む。 しか…

Ruby | CLI | Be Easy to Use | CommandLineを理解する | Arguments

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 CommandLineを理解する 詳細 Be Easy to Use | CommandLineの構成要素を理解する | Arguments Arguments Arguments はコマンドラインで扱う対象を表す。 典型的な例としては、ファイル名やデ…

Ruby | CLI | Be Easy to Use | CommandLineを理解する | Options

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 CommandLineを理解する 詳細 Be Easy to Use | CommandLineの構成要素を理解する | Options Options Optionsはユーザーがアプリケーションの動作を変えるための方法です。・Short-Form Short…

Ruby | CLI | Be Easy to Use | CommandLineを理解する

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Easy to Use | CommandLineを理解する 詳細 CommandLineの構成要素を理解する 基本構成 例えば ls コマンドで rb のファイルを更新日付の降順で詳細表示したい場合 ls -ltr *.rb のように…

Ruby | CLI | Be Easy to Use

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Be Easy to Use 詳細 自分のアプリケーションをインストール後、Userが初めに経験するのはCLIだろう。 CLIが難しく、直観的ではなく、醜くければ多くの信頼を得られないだろう。 逆に、もし…

Ruby | CLI | Have a Clear Concise Purpose | 素晴らしいCLI Appを作るには

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Have a Clear Concise Purposee | 素晴らしいCLI Appを作るには 素晴らしいCLI Appの特徴 ・Easy to user ・Helpful ・Plays well with others ・Has sensible defaults but is configurable…

Ruby | CLI | Have a Clear Concise Purpose | サブセットを持つコマンド

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Have a Clear Concise Purposee | サブセットを持つコマンド サブセットを持つコマンド例:仕様 ※書籍に載っていたものとは全く別のものです。 同じような内容を自分独自の仕様で考えました…

Ruby | CLI | Have a Clear Concise Purpose | 単一目的のシンプルなケースへの変更例

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Have a Clear Concise Purposee | 単一目的のシンプルなケースへの変更例 ツールの単純化例:仕様 ※書籍に載っていたものとは全く別のものです。 同じような内容を自分独自の仕様で考えまし…

Ruby | CLI | Have a Clear Concise Purpose

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Have a Clear Concise Purpose 詳細 単一目的のコマンドラインアプリケーションが望ましい。 入力を受け取り、出力を提供する。驚くほどシンプルな手法。単一目的のツールは、覚えるのが簡単…

書籍 Build Awesome Command-Line Applications in Ruby2

概要 書籍 Build Awesome Command-Line Applications in Ruby2に関するまとめ 一覧 章 詳細 URL/内容 Introduction -- http://d.hatena.ne.jp/tbpg/20140521/1400681014 Have a Clear Concise Purpose 概要 http://d.hatena.ne.jp/tbpg/20140522/1400762298 …

Ruby | CLI | Introduction

概要 書籍 Build Awesome Command-Line Applications in Ruby2 章 Introduction 詳細 開発環境の変遷 〜 1990年代 JavaがメジャーになるとともにGUI、IDEなどが普及。 旧来のCLIのツールは時代遅れのものと認識されがちになってきた。Java + GUIの環境は非常…