boostorg / boostorg/program_options

parse_config_file: alternate comment interpretation

オープン
#100 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
136
フォーク
117
PR マージ指標
30日以内にマージされた PR はありません

説明

For some time `parse_config_file` treats all `#` signs as initiating comments, preventing the use of `#` signs in values.

It would be very helpful if a simple flag could be set, to only consider # signs in column 0, or preceded only by whitespace, as comments. This would make for clearer, cleaner code and configuration files, when configuration values contain `#`.

Here's an example of somebody looking for this, and being advised to write an iostreams filter to make it work:
https://stackoverflow.com/questions/31921241/boostprogram-options-how-to-support-hash-character-in-a-value

Here's an example of brute-force key generation implemented in a production release, to make sure the key never contains the `#` symbol and can be stored in the configuration file:
https://github.com/libbitcoin/libbitcoin-protocol/blob/version3/src/zmq/certificate.cpp#L78

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず parse_config_file の実装と、既存のテストまたはドキュメントを見つけます。現在 # がどのように解釈されているかを確認し、そのうえで、値内の # を保持しながら、オプトイン設定によって 0 列目または空白の後にある # をどのように扱うべきかを判断します。要求された設定が文書化され、コメントと値の両方のケースについてテストでカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。