Trope Doc

Trope is a simple command line utility for merging various config file types and environmental variables into either YAML or JSON. It is a pure Rust implementation built for speed and as a showcase of Rust's ability to handle merging different types. It uses clap-rs for CLI interpretation, config-rs for file handling and serde for serialization.

Supported File Types

Trope supports the following file types as inputs:

Installation

Usage

Once installed, using Trope is simple: trope [FLAGS] [OPTIONS]...
Typing trope -h provides an in-console listing of all the information listed here.

Features

Flags

Options

Examples

Using three sample files: Settings.yaml, Server.toml and Johndoe.json listed below:

Settings.yaml

```yaml

debug: false port: 8080 host: 0.0.0.0 test-float: 3.4 test-int: 43 array: - One - two: a: 1 b: 2 - three ```

Server.toml

```toml [servers]

[servers.alpha] ip = "10.0.0.1" dc = "eqdc10"

[servers.beta] ip = "10.0.0.2" dc = "eqdc10" country = "中国" ```

Johndoe.json

json { "name": "John Doe", "age": 40, "address": { "street": "11 Castle Lane", "city": "London" }, "phones": [ "+44 1234567", "+44 2345678" ] }

Running trope -I Settings.yaml Server.toml Johndoe.json -O output.yaml from the working directory will return a file named output.yaml:

```yaml

age: 40 "test-int": 43 address: street: 11 Castle Lane city: London host: 0.0.0.0 phones: - +44 1234567 - +44 2345678 name: John Doe port: 8080 array: - One - two: b: 2 a: 1 - three debug: false servers: beta: dc: eqdc10 ip: 10.0.0.2 country: 中国 alpha: ip: 10.0.0.1 dc: eqdc10 "test-float": 3.4 ```

Known Bugs