oops-cli 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.ja.md +4 -0
- data/CHANGELOG.md +4 -0
- data/README.ja.md +31 -5
- data/README.md +31 -5
- data/lib/oops/cli.rb +10 -2
- data/lib/oops/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 198d943e18681e15c4337a230169aa820d648005bd46e0fdeb76f501ebf41fdb
|
|
4
|
+
data.tar.gz: e8b857eec4950276fcaed4cda06b0c2bd44fdaef3ab0c43abcd5101bcdc3329a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 807a1c5368cc76979cafb4db32a7235a77777483f4d8726b96ea1841aaf495b0c9515ebf9ab5225bfe51f24e95bfb350170ec7ccf772c3a47a7725ede3b1c305
|
|
7
|
+
data.tar.gz: 65259cb6bd461f49566064f27ca59beebce69851c3be6be4a8a0a689dd0ef77f34a1701e54b702a2649aacfcad345f1aa1a925dd46775a5bb9507be7b7b2f276
|
data/CHANGELOG.ja.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[English](CHANGELOG.md) | 日本語
|
|
4
4
|
|
|
5
|
+
## 0.4.0 - 2026-11-03
|
|
6
|
+
|
|
7
|
+
- `--print` / `-p` を追加。クリップボードの代わりに整形したテキストを標準出力へ書き出し、SSH 先・コンテナ・スクリプトからパイプできるようにします([#40](https://github.com/ysb3996-blip/oops/issues/40))。[@ShahadatTest](https://github.com/ShahadatTest) さんによる貢献([#52](https://github.com/ysb3996-blip/oops/pull/52))。
|
|
8
|
+
|
|
5
9
|
## 0.3.0 - 2026-11-02
|
|
6
10
|
|
|
7
11
|
- `oops clear` で閉じたタブのログを削除できます。`oops clear --all` は今のタブのログも空にします([#42](https://github.com/ysb3996-blip/oops/issues/42))。
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
English | [日本語](CHANGELOG.ja.md)
|
|
4
4
|
|
|
5
|
+
## 0.4.0 - 2026-11-03
|
|
6
|
+
|
|
7
|
+
- `--print` / `-p`: write the formatted text to stdout instead of the clipboard, so SSH sessions, containers and scripts can pipe it ([#40](https://github.com/ysb3996-blip/oops/issues/40)). Contributed by [@ShahadatTest](https://github.com/ShahadatTest) in [#52](https://github.com/ysb3996-blip/oops/pull/52).
|
|
8
|
+
|
|
5
9
|
## 0.3.0 - 2026-11-02
|
|
6
10
|
|
|
7
11
|
- `oops clear` deletes the logs of closed tabs, and `oops clear --all` also empties the current tab's log ([#42](https://github.com/ysb3996-blip/oops/issues/42)).
|
data/README.ja.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 日本語
|
|
4
4
|
|
|
5
|
-
[](https://rubygems.org/gems/oops-cli) [](https://github.com/ysb3996-blip/oops/actions/workflows/ci.yml) [](LICENSE)
|
|
5
|
+
[](https://rubygems.org/gems/oops-cli) [](https://github.com/ysb3996-blip/oops/actions/workflows/ci.yml) [](LICENSE) [](https://codecov.io/gh/ysb3996-blip/oops) [](#貢献してくれた人たち)
|
|
6
6
|
|
|
7
7
|
直前のシェルコマンドとその出力を、貼り付けられる形でクリップボードにコピーします。
|
|
8
8
|
|
|
@@ -31,6 +31,8 @@ Homebrew 版は Homebrew の Ruby で oops を動かすので、`PATH` の先に
|
|
|
31
31
|
|
|
32
32
|
macOS または Linux(WSL は Linux 扱い)、Ruby 3.3 以降、zsh・bash・fish のどれかが必要です。実行時に依存する gem はありません。
|
|
33
33
|
|
|
34
|
+
macOS の Terminal.app・iTerm2・Ghostty・VS Code の統合ターミナルで、手で動作を確かめています。ほかの端末でおかしな動きがあれば、issue で教えてください。
|
|
35
|
+
|
|
34
36
|
`gem install` は、そのとき有効な Ruby にだけ oops を入れます。gem は Ruby のバージョンごとに別々です。rbenv・asdf・mise などで別の Ruby を使うタブでは、`oops` が `command not found` のエラーになります(シェルの起動時にも出ます)。いつでも使える直し方は、有効な Ruby で `gem install oops-cli` をもう一度実行することです(rbenv なら続けて `rbenv rehash`)。`.ruby-version`・`.tool-versions`・`mise.toml` で Ruby を指定しているディレクトリの外では、代わりにインストールした Ruby を標準(グローバル)の Ruby に設定することもできます(例: `rbenv global 3.3.5`)。
|
|
35
37
|
|
|
36
38
|
### zsh のプラグインマネージャーで入れる
|
|
@@ -112,13 +114,14 @@ oops init fish | source
|
|
|
112
114
|
| `--head N` | 出力の最初の N 行だけ残す(`--tail` と併用すると両端を残す) |
|
|
113
115
|
| `--time` | 各コマンドの開始時刻を `# 2026-10-31 19:30:09 +09:00` の行として付ける |
|
|
114
116
|
| `--output-only` | `$ コマンド` の行を省き、出力だけをコピーする |
|
|
117
|
+
| `-p`, `--print` | クリップボードの代わりに標準出力へ書き出す(`copied:` 行は出さない) |
|
|
115
118
|
| `--show-secrets` | 秘密情報をマスクせず、置換テーブルも適用しない |
|
|
116
119
|
|
|
117
120
|
`N` は正の整数で指定します。件数は位置引数の `N` または `-n N` のどちらかで 1 回だけ指定でき、併用や `-n` の繰り返しは使い方の誤りになります。対象のコマンドが指定件数より少なければ、見つかった分をコピーします。`-n` は上記の書式オプションと併用できます。
|
|
118
121
|
|
|
119
122
|
`oops` 自身はコピー対象になりません。直前のコマンドが `oops` だった場合は、その前のコマンドがコピーされます。
|
|
120
123
|
|
|
121
|
-
終了コード: `0`
|
|
124
|
+
終了コード: `0` コピーした(または `--print` で出力した)、`1` コピーしなかった(記録していない、まだコマンドがない、失敗したコマンドがない、一時停止中、クリップボードのコマンドが失敗)、`2` 使い方の誤り。
|
|
122
125
|
|
|
123
126
|
### 標準の出力
|
|
124
127
|
|
|
@@ -279,11 +282,11 @@ bundle exec exe/oops doctor
|
|
|
279
282
|
|
|
280
283
|
```sh
|
|
281
284
|
gem build oops-cli.gemspec
|
|
282
|
-
gem install ./oops-cli-0.
|
|
285
|
+
gem install ./oops-cli-0.4.0.gem # ファイル名は lib/oops/version.rb に合わせる
|
|
283
286
|
rbenv rehash # rbenv を使う場合のみ
|
|
284
287
|
```
|
|
285
288
|
|
|
286
|
-
- gem は Ruby のバージョンごとに入ります。新しいタブが、インストールした Ruby とは別の Ruby を使っていると(たとえばリポジトリは 4.0.9 を指定しているのに、標準の Ruby が 3.3.5 の場合)、シェルの起動時に oops が見つからなくなります(bash では `bash: oops: command not found`、zsh では `command not found: oops` と出ます)。その Ruby でも `gem install` を実行してください(例: `RBENV_VERSION=3.3.5 gem install ./oops-cli-0.
|
|
289
|
+
- gem は Ruby のバージョンごとに入ります。新しいタブが、インストールした Ruby とは別の Ruby を使っていると(たとえばリポジトリは 4.0.9 を指定しているのに、標準の Ruby が 3.3.5 の場合)、シェルの起動時に oops が見つからなくなります(bash では `bash: oops: command not found`、zsh では `command not found: oops` と出ます)。その Ruby でも `gem install` を実行してください(例: `RBENV_VERSION=3.3.5 gem install ./oops-cli-0.4.0.gem`)。
|
|
287
290
|
- 変更のたびに入れ直してください。インストールされた gem はコピーで、チェックアウトへのリンクではありません。
|
|
288
291
|
- 削除するには `gem uninstall oops-cli` です。
|
|
289
292
|
- `eval "$(oops init zsh)"` は、プロンプトで打つだけでなく rc ファイルに書いてください。記録されるシェルは rc ファイルを読み直すため、行がないとフックが入りません(`oops doctor` に `hooks: missing` と出ます)。
|
|
@@ -294,7 +297,7 @@ rbenv rehash # rbenv を使う場合のみ
|
|
|
294
297
|
|
|
295
298
|
リリース前の手動チェックリスト:
|
|
296
299
|
|
|
297
|
-
- Ghostty、Terminal.app、VS Code の統合ターミナルで、マーカーのゴミが表示されない。
|
|
300
|
+
- Ghostty、Terminal.app、iTerm2、VS Code の統合ターミナルで、マーカーのゴミが表示されない。
|
|
298
301
|
- vim、less、全画面の端末アプリが、ウィンドウをリサイズしても追従する。
|
|
299
302
|
- 記録中のタブで `exec zsh` しても、2 つ目の記録が始まらない。
|
|
300
303
|
- 記録中のタブから `code .` で開いた VS Code のターミナルが、独立して記録される。
|
|
@@ -303,6 +306,29 @@ rbenv rehash # rbenv を使う場合のみ
|
|
|
303
306
|
|
|
304
307
|
バグ報告、アイデア、プルリクエストを歓迎します。[CONTRIBUTING.ja.md](CONTRIBUTING.ja.md) を読んでください。`good first issue` のラベルが付いた issue が、始めやすい入口です。プルリクエストには、テストと rubocop の結果、新しいタブでの動作確認を必ず貼ってください([プルリクエストに必ず貼るもの](CONTRIBUTING.ja.md#プルリクエストに必ず貼るもの))。
|
|
305
308
|
|
|
309
|
+
## 貢献してくれた人たち
|
|
310
|
+
|
|
311
|
+
手伝ってくれたみなさん、ありがとうございます([絵文字の意味](https://allcontributors.org/docs/en/emoji-key))。追加するときは、issue かプルリクエストに `@all-contributors please add @<ユーザー名> for <貢献の種類>` とコメントしてください。
|
|
312
|
+
|
|
313
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
314
|
+
<!-- prettier-ignore-start -->
|
|
315
|
+
<!-- markdownlint-disable -->
|
|
316
|
+
<table>
|
|
317
|
+
<tbody>
|
|
318
|
+
<tr>
|
|
319
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ysb3996-blip"><img src="https://avatars.githubusercontent.com/u/257992595?v=4?s=80" width="80px;" alt="ysb3996-blip"/><br /><sub><b>ysb3996-blip</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=ysb3996-blip" title="Code">💻</a> <a href="https://github.com/ysb3996-blip/oops/commits?author=ysb3996-blip" title="Documentation">📖</a> <a href="https://github.com/ysb3996-blip/oops/commits?author=ysb3996-blip" title="Tests">⚠️</a> <a href="#maintenance-ysb3996-blip" title="Maintenance">🚧</a></td>
|
|
320
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ricky9408"><img src="https://avatars.githubusercontent.com/u/49530170?v=4?s=80" width="80px;" alt="Sanghyuk Lee"/><br /><sub><b>Sanghyuk Lee</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=ricky9408" title="Code">💻</a></td>
|
|
321
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/agenticsymphony-tech"><img src="https://avatars.githubusercontent.com/u/326739730?v=4?s=80" width="80px;" alt="agenticsymphony-tech"/><br /><sub><b>agenticsymphony-tech</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=agenticsymphony-tech" title="Documentation">📖</a></td>
|
|
322
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ShahadatTest"><img src="https://avatars.githubusercontent.com/u/179203101?v=4?s=80" width="80px;" alt="ShahadatTest"/><br /><sub><b>ShahadatTest</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=ShahadatTest" title="Code">💻</a></td>
|
|
323
|
+
</tr>
|
|
324
|
+
</tbody>
|
|
325
|
+
</table>
|
|
326
|
+
|
|
327
|
+
<!-- markdownlint-restore -->
|
|
328
|
+
<!-- prettier-ignore-end -->
|
|
329
|
+
|
|
330
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
331
|
+
|
|
306
332
|
## ライセンス
|
|
307
333
|
|
|
308
334
|
MIT。[LICENSE](LICENSE) を参照してください。
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [日本語](README.ja.md)
|
|
4
4
|
|
|
5
|
-
[](https://rubygems.org/gems/oops-cli) [](https://github.com/ysb3996-blip/oops/actions/workflows/ci.yml) [](LICENSE)
|
|
5
|
+
[](https://rubygems.org/gems/oops-cli) [](https://github.com/ysb3996-blip/oops/actions/workflows/ci.yml) [](LICENSE) [](https://codecov.io/gh/ysb3996-blip/oops) [](#contributors)
|
|
6
6
|
|
|
7
7
|
Copy the last shell command and its output to the clipboard, ready to paste.
|
|
8
8
|
|
|
@@ -31,6 +31,8 @@ The Homebrew formula runs oops with Homebrew's own Ruby, so it works even if an
|
|
|
31
31
|
|
|
32
32
|
Requires Ruby 3.3 or newer on macOS or Linux (WSL counts as Linux), and zsh, bash or fish. There are no runtime gem dependencies.
|
|
33
33
|
|
|
34
|
+
Checked by hand on macOS in Terminal.app, iTerm2, Ghostty and the VS Code integrated terminal. If it misbehaves in another terminal, please open an issue.
|
|
35
|
+
|
|
34
36
|
`gem install` puts oops into the Ruby that is active at that moment; each Ruby version has its own gems. With rbenv, asdf or mise, a tab that uses another Ruby gives a `command not found` error for `oops`, also when the shell starts. The fix that always works is to run `gem install oops-cli` again under the active Ruby (with rbenv, follow with `rbenv rehash`). Outside directories that pin a Ruby with `.ruby-version`, `.tool-versions` or `mise.toml`, you can instead set the Ruby you installed into as your global Ruby (for example `rbenv global 3.3.5`).
|
|
35
37
|
|
|
36
38
|
### With a zsh plugin manager
|
|
@@ -112,13 +114,14 @@ Options for `oops`, `oops N` and `oops err`:
|
|
|
112
114
|
| `--head N` | Keep only the first N output lines (with `--tail`, keeps both ends) |
|
|
113
115
|
| `--time` | Add the time each command started as a `# 2026-10-31 19:30:09 +09:00` line |
|
|
114
116
|
| `--output-only` | Leave out the `$ command` line and copy only the output |
|
|
117
|
+
| `-p`, `--print` | Write the text to stdout instead of the clipboard (no `copied:` line) |
|
|
115
118
|
| `--show-secrets` | Do not mask secrets and do not apply the replace table |
|
|
116
119
|
|
|
117
120
|
`N` must be a positive integer. Specify the command count once, either as a positional `N` or with `-n N`; combining them or repeating `-n` is a usage error. If fewer matching commands are available, oops copies those it finds. `-n` can be combined with the formatting options above.
|
|
118
121
|
|
|
119
122
|
`oops` never copies itself: if the previous command was `oops`, you get the command before it.
|
|
120
123
|
|
|
121
|
-
Exit codes: `0` copied, `1` nothing copied (not recording, no command yet, no failed command, paused, or the clipboard command failed), `2` usage error.
|
|
124
|
+
Exit codes: `0` copied (or printed with `--print`), `1` nothing copied (not recording, no command yet, no failed command, paused, or the clipboard command failed), `2` usage error.
|
|
122
125
|
|
|
123
126
|
### Default output
|
|
124
127
|
|
|
@@ -279,11 +282,11 @@ To try it as your shell does, build and install the gem into the Ruby you are us
|
|
|
279
282
|
|
|
280
283
|
```sh
|
|
281
284
|
gem build oops-cli.gemspec
|
|
282
|
-
gem install ./oops-cli-0.
|
|
285
|
+
gem install ./oops-cli-0.4.0.gem # the file name follows lib/oops/version.rb
|
|
283
286
|
rbenv rehash # only with rbenv
|
|
284
287
|
```
|
|
285
288
|
|
|
286
|
-
- A gem is installed per Ruby version. If a new tab uses another Ruby than the one you installed into (for example the repository pins 4.0.9, but your global Ruby is 3.3.5), the shell cannot find oops when it starts (bash prints `bash: oops: command not found`, zsh prints `command not found: oops`). Run `gem install` again under that Ruby, e.g. `RBENV_VERSION=3.3.5 gem install ./oops-cli-0.
|
|
289
|
+
- A gem is installed per Ruby version. If a new tab uses another Ruby than the one you installed into (for example the repository pins 4.0.9, but your global Ruby is 3.3.5), the shell cannot find oops when it starts (bash prints `bash: oops: command not found`, zsh prints `command not found: oops`). Run `gem install` again under that Ruby, e.g. `RBENV_VERSION=3.3.5 gem install ./oops-cli-0.4.0.gem`.
|
|
287
290
|
- Reinstall after every change. The installed gem is a copy, not a link to your checkout.
|
|
288
291
|
- To remove it: `gem uninstall oops-cli`.
|
|
289
292
|
- Put `eval "$(oops init zsh)"` in your rc file, not just at the prompt: the recorded shell reads the rc file again, and without the line it has no hooks (`oops doctor` shows `hooks: missing`).
|
|
@@ -294,7 +297,7 @@ The tests cover formatting, secret masking, the log reader, the stream parser an
|
|
|
294
297
|
|
|
295
298
|
Manual checklist before a release:
|
|
296
299
|
|
|
297
|
-
- No marker garbage is visible in Ghostty, Terminal.app and the VS Code integrated terminal.
|
|
300
|
+
- No marker garbage is visible in Ghostty, Terminal.app, iTerm2 and the VS Code integrated terminal.
|
|
298
301
|
- vim, less and a full-screen terminal app keep up while you resize the window.
|
|
299
302
|
- `exec zsh` in a recorded tab does not start a second recording.
|
|
300
303
|
- A VS Code terminal opened with `code .` from a recorded tab is recorded on its own.
|
|
@@ -303,6 +306,29 @@ Manual checklist before a release:
|
|
|
303
306
|
|
|
304
307
|
Bug reports, ideas and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md); issues labeled `good first issue` are a good place to start. Every pull request must include the test and rubocop results and a check in a new terminal tab; see [What every pull request must include](CONTRIBUTING.md#what-every-pull-request-must-include).
|
|
305
308
|
|
|
309
|
+
## Contributors
|
|
310
|
+
|
|
311
|
+
Thanks to everyone who has helped ([emoji key](https://allcontributors.org/docs/en/emoji-key)). To add someone, comment `@all-contributors please add @<username> for <contributions>` on an issue or pull request.
|
|
312
|
+
|
|
313
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
314
|
+
<!-- prettier-ignore-start -->
|
|
315
|
+
<!-- markdownlint-disable -->
|
|
316
|
+
<table>
|
|
317
|
+
<tbody>
|
|
318
|
+
<tr>
|
|
319
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ysb3996-blip"><img src="https://avatars.githubusercontent.com/u/257992595?v=4?s=80" width="80px;" alt="ysb3996-blip"/><br /><sub><b>ysb3996-blip</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=ysb3996-blip" title="Code">💻</a> <a href="https://github.com/ysb3996-blip/oops/commits?author=ysb3996-blip" title="Documentation">📖</a> <a href="https://github.com/ysb3996-blip/oops/commits?author=ysb3996-blip" title="Tests">⚠️</a> <a href="#maintenance-ysb3996-blip" title="Maintenance">🚧</a></td>
|
|
320
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ricky9408"><img src="https://avatars.githubusercontent.com/u/49530170?v=4?s=80" width="80px;" alt="Sanghyuk Lee"/><br /><sub><b>Sanghyuk Lee</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=ricky9408" title="Code">💻</a></td>
|
|
321
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/agenticsymphony-tech"><img src="https://avatars.githubusercontent.com/u/326739730?v=4?s=80" width="80px;" alt="agenticsymphony-tech"/><br /><sub><b>agenticsymphony-tech</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=agenticsymphony-tech" title="Documentation">📖</a></td>
|
|
322
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ShahadatTest"><img src="https://avatars.githubusercontent.com/u/179203101?v=4?s=80" width="80px;" alt="ShahadatTest"/><br /><sub><b>ShahadatTest</b></sub></a><br /><a href="https://github.com/ysb3996-blip/oops/commits?author=ShahadatTest" title="Code">💻</a></td>
|
|
323
|
+
</tr>
|
|
324
|
+
</tbody>
|
|
325
|
+
</table>
|
|
326
|
+
|
|
327
|
+
<!-- markdownlint-restore -->
|
|
328
|
+
<!-- prettier-ignore-end -->
|
|
329
|
+
|
|
330
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
331
|
+
|
|
306
332
|
## License
|
|
307
333
|
|
|
308
334
|
MIT. See [LICENSE](LICENSE).
|
data/lib/oops/cli.rb
CHANGED
|
@@ -25,7 +25,8 @@ module Oops
|
|
|
25
25
|
when "clear" then return clear(argv.drop(1), env: env, stdout: stdout)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
options = { head: nil, tail: nil, github: false, show_secrets: false, time: false, output_only: false
|
|
28
|
+
options = { head: nil, tail: nil, github: false, show_secrets: false, time: false, output_only: false,
|
|
29
|
+
print: false }
|
|
29
30
|
count = nil
|
|
30
31
|
parser = OptionParser.new do |o|
|
|
31
32
|
o.banner = "Usage: oops [N | err] [-n N] [options]\n " \
|
|
@@ -41,6 +42,7 @@ module Oops
|
|
|
41
42
|
o.on("--time", "Add the time each command started") { options[:time] = true }
|
|
42
43
|
o.on("--output-only", "Leave out the command line, keep the output") { options[:output_only] = true }
|
|
43
44
|
o.on("--show-secrets", "Do not mask secrets or apply the replace table") { options[:show_secrets] = true }
|
|
45
|
+
o.on("-p", "--print", "Write the text to stdout instead of the clipboard") { options[:print] = true }
|
|
44
46
|
o.on("-v", "--version", "Print version and exit") do
|
|
45
47
|
stdout.puts "oops #{VERSION}"
|
|
46
48
|
return 0
|
|
@@ -89,7 +91,13 @@ module Oops
|
|
|
89
91
|
raise Failure, (target.failed_only ? "no failed command found." : "no command found yet.") if records.empty?
|
|
90
92
|
|
|
91
93
|
home = env["HOME"].to_s.empty? ? Dir.home : env["HOME"]
|
|
92
|
-
|
|
94
|
+
format_options = options.except(:print)
|
|
95
|
+
result = Formatter.new(config: config, home: home, **format_options).format(records)
|
|
96
|
+
if options[:print]
|
|
97
|
+
stdout.write result.text
|
|
98
|
+
return 0
|
|
99
|
+
end
|
|
100
|
+
|
|
93
101
|
backend = Clipboard.detect(config.clipboard, env: env)
|
|
94
102
|
raise Failure, NO_CLIPBOARD if backend.nil?
|
|
95
103
|
|
data/lib/oops/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: oops-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ysb3996-blip
|
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
69
|
version: '0'
|
|
70
70
|
requirements: []
|
|
71
|
-
rubygems_version: 4.0.
|
|
71
|
+
rubygems_version: 4.0.23
|
|
72
72
|
specification_version: 4
|
|
73
73
|
summary: Copy the last shell command and its output to the clipboard
|
|
74
74
|
test_files: []
|