yaml optimize
1.0.0
YAML Optimiserは、C ++で書かれたライブラリとコマンドラインツールのセットです。ライブラリは、エイリアス(アンカー)、参照、およびキー(オーバーライド)を使用して、大規模なYAML構成を最適化するのに役立ちます。 Yamlの解析と操作のためにRapidyAmlライブラリを活用します。
このプロジェクトは、大規模なYAML構成を最適化するための高速で便利な方法を提供することを目的としています。
現在、ライブラリは完全に同一のノードの最適化のみをサポートしています。
# YAML example with references and anchors
# Define an anchor for a nested sequence
- top_level :
- nested :
- - Apple
- Orange
- Banana
# Define an anchor for a nested mapping
- another_level :
- even_deeper :
- further :
- key1 : value1
key2 : value2
# Use the anchors in different parts of the YAML
- other_level :
- some_key :
- Apple
- Orange
- Banana
- additional_key :
key1 : value1
key2 : value2
# Additional data
- SomeList :
- 1
- 2
- 3
- 4
- SomeValue : trueしたがって、結果は次のとおりです(インデントとコメントは現在削除されていることに注意してください):
- top_level :
- nested :
- &anchor_0
- Apple
- Orange
- Banana
- another_level :
- even_deeper :
- further :
- &anchor_1
key1 : value1
key2 : value2
- other_level :
- some_key : *anchor_0
- additional_key : *anchor_1
- SomeList :
- 1
- 2
- 3
- 4
- SomeValue : true インストールはかなり簡単です。まず第一に、リポジトリをクローンして、サブモジュールを再帰的にダウンロードします。
git clone https://github.com/Mr-S-Mirzoev/yaml-optimize.git --recursiveリポジトリの機能をテストしたい場合は、リポジトリの上部のみをクローンすることをお勧めします。
git clone https://github.com/Mr-S-Mirzoev/yaml-optimize.git --recursive --depth=1次に、レポディレクトリで、cmakeでプロジェクトを生成します。
cmake -B build -DYO_BUILD_TOOLS=1 -DYO_BUILD_TESTS=1 -DCMAKE_BUILD_TYPE=Releaseここでは、Yaml-Optimizeライブラリを構築するときに使用できるフラグが表示されます。 yo_build_toolsとyo_build_testsはデフォルトで0です。ビルドを最小限に抑えたいためです。 yo_build_toolsオプションをチェックすると、ツールyaml-optimize、およびyaml-resolveが構築されます。
USAGE:
yaml-optimize [-?|-h|--help] [-l|--limit <optimization limit>] -i|--input <input> [-o|--output <output>] [-v|--verbose]
YAML Optimizer - A tool for optimising YAML configurations with the use of anchors, references and merge keys
OPTIONS, ARGUMENTS:
-?, -h, --help
-l, --limit <optimization limit>
limit to when to stop optimisation
-i, --input <input> path to input file
-o, --output <output> path to output file (defaults to input filename + ".optimized")
-v, --verbose enable verbose mode
USAGE:
yaml-resolve [-?|-h|--help] -i|--input <input> [-o|--output <output>] [-v|--verbose]
YAML Resolver - A tool for resolving YAML optimised configurations with anchors, references, and merge keys, substituting them to obtain the complete YAML configuration
OPTIONS, ARGUMENTS:
-?, -h, --help
-i, --input <input> path to input file
-o, --output <output> path to output file (defaults to input filename + ".resolved")
-v, --verbose enable verbose mode
これで、プロジェクトを構築できます。
cmake --build build -j8 --config Debug