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 설치는 매우 쉽습니다. 우선, Repo를 복제하여 소형 모듈을 재귀 적으로 다운로드하십시오.
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다음으로 Repo 디렉토리에서 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 RESOLFY가 구축됩니다.
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