files-converter - is a tool specifically designed to convert source configuration files or *.cf files from one format to another. This project uses Cobra for advanced parameter handling, simplified command-line interface, and argument and parameter management.
Configuration File Conversion: Convert configuration files or *.cf files between different formats.
Customizable Options: Specify output formats, file destinations, and more.
- Conversion of the *.cf form to *.cfe is implemented.
- Conversion of source files to *.cfe is implemented.
The files-converter tool can be configured using a JSON configuration file, allowing you to predefine settings such as input paths, output paths, and conversion types.
-
platform_version
: (string) Specifies the required platform version.- Example:
"platform_version": "8.3.23"
- Example:
-
extension
: (string) Specifies the name of the extension.- Example:
"extension": "PSSL"
- Example:
-
input_path
: (string) Path to the directory or file to be converted.- Example:
"input_path": "C:/path/to/input"
- Example:
-
output_path
: (string) Path where the converted files will be saved.- Example:
"output_path": "C:/path/to/output"
- Example:
-
conversion_type
: (string) Specifies the type of conversion to perform. Valid values are"srcConvert"
and"cfConvert"
.- Example:
"conversion_type": "srcConvert"
- Example:
-
xml_files
: (array) A list of XML files and their associated operations.file_name
: (string) The name of the XML file to operate on.- Example:
"file_name": "example.xml"
- Example:
element_operations
: (array) A list of operations to perform on elements within the XML file.element_name
: (string) The name of the XML element to modify.- Example:
"element_name": "SampleElement"
- Example:
operation
: (string) The type of operation ("add"
,"delete"
,"modify"
).- Example:
"operation": "modify"
- Example:
value
: (string, optional) The new value to set for the element (used withadd
andmodify
operations).- Example:
"value": "NewValue"
- Example:
Here's an example of a configuration file (config.json
):
{
"platform_version": "8.3.23",
"extension": "ПроектнаяБиблиотекаПодсистем",
"input_path": "C:/path/to/source",
"output_path": "C:/path/to/output",
"conversion_type": "srcConvert",
"xml_files": [
{
"file_name": "example.xml",
"element_operations": [
{
"element_name": "SampleElement",
"operation": "modify",
"value": "NewValue"
}
]
}
]
}
It can be installed by running:
go install github.com/firstBitSportivnaya/files-converter@latest
Note: The use of this program requires the appropriate platform (8.3.23).
For more information on available commands and options:
files-converter --help
Using the configuration file:
files-converter --config="configs/config.json"
If no --config flag is provided, the program will use the default configuration file located at $HOME/.files-converter/configs/config.json:
files-converter
This project is licensed under the MIT License. See the LICENSE file for details.