Repository navigation
server: -d/--database をサブコマンド側でもグローバル側でも受け付ける - #336
Merged
Merged
Conversation
runner の DB 必須チェック(needs_database?)はグローバル --database を、 ServerCommand#parse は自前の --database を見ていたため、片方だけでは 「no database given」か「missing database path」で起動できなかった。 usage.md の例 `bitclust server -d ./db-3_4 ...` も server 側に -d が無く ambiguous option だった。 - ServerCommand#needs_database? を false にして runner に要求させない (ancestors と同じ扱い) - DB パスの解決を exec 時の resolve_dbpath に移し、サブコマンド側の -d/--database が無ければグローバル --database(options[:prefix])を使う - server に短縮形 -d を追加 - usage.md にグローバル側で指定する例と、--debug なしはデーモン化する ことを書き添える Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
znz
commented
Sep 25, 2026
| bitclust -d ./db-3_4 server --baseurl="" --port=30080 --debug # グローバル側の -d でも可 | ||
| ``` | ||
|
|
||
| `--debug` を付けないとデーモンとして起動します(端末には戻ってきます)。 |
Member
Author
There was a problem hiding this comment.
「(端末には戻ってきます)」は不要に感じました。残すなら「(端末に戻ってきます)」でしょうか。
Comment on lines
+223
to
+224
| $stderr.puts "missing database path. Use --database (-d)" | ||
| exit 1 |
Member
Author
There was a problem hiding this comment.
abort("...message...") にまとめられそうです。
- usage.md の「(端末には戻ってきます)」を削除 - resolve_dbpath の stderr 出力+exit を abort にまとめる - テストファイル冒頭の経緯説明を削除(経緯はコミットログと PR に残す) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
レビューありがとうございます。0ab0919 で対応しました。
🤖 Generated with Claude Code |
This was referenced Sep 25, 2026
Merged
znz
added a commit
to znz/bitclust
that referenced
this pull request
Sep 28, 2026
v1.7.0 以降の変更を収録する。 - rurema#332 DB 無し時のリモート検索フォールバック - rurema#331 front matter のゲート付きリストの #%else/#%version 対応(rurema#333) - rurema#335 出力監査で見つかった server/query/epub/chm/highlighter/extract の 不具合修正(rurema#336〜rurema#342)と経緯コメントの整理(rurema#343) - rurema#345 動かないもの・旧 RD ソース専用の tools の削除(rurema#346) 新規 gem は無いので trusted publisher の追加登録は不要。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #335(不具合 1)
概要
bitclust serverは runner の DB 必須チェック(needs_database?)がグローバル--databaseを見る一方、ServerCommand#parseは自前の--databaseを見ていたため、片方だけでは「no database given」か「missing database path」で止まり、両方に書かないと起動できませんでした。doc/usage.mdの例bitclust server -d ./db-3_4 ...も server 側に-dが無くambiguous optionでした(bitclust setup済みで設定ファイルがあると既定 DB が入るので気づきにくい状態でした)。変更点
ServerCommand#needs_database?を false にして runner にグローバル側を要求させない(ancestorsと同じ扱い)exec時のresolve_dbpathに移し、サブコマンド側の-d/--databaseが無ければグローバル--database(options[:prefix])を使う。どちらも無く--autoでもなければ従来どおり案内して終了-dを追加(usage.md の例がそのまま動く)--debugなしはデーモン化することを追記検証
test/test_server_command.rb(5 件)・全テスト green・steep checkOKserver -d DB/-d DB server/server --database=DBの 3 形式とも起動し/view/class/Arrayが 200🤖 Generated with Claude Code