/rust-parser

Rust CLI Parser

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Overview

parser is used to create, store, and update environment variable(s) used in both development and deployment context. Additionally, through the simplicity of key = value variable assignments, parser can construct a variety of file-types:

  • *.env
  • toml
  • Yaml
  • JSON
  • ini

Design Philosophy

All environment variables are capable of being abstracted into a simple key-value structure generalizable to compiled, runtime, & serialization languages:

{
    "Key": "Value"
}
---
Variable:
    Key: ...
    Value: ...
struct Variable {
    char * key;
    char * value;
} Variable; 
struct Variable {
    key: &str,
    value: &str
}
class Variable {
    static Key;
    static Value;
}
class Variable:
    Key: str
    Value: str

Because of key-value serialization capabilities, parser transforms command-line input into streamable HTTP requests; these requests can then interface distributed key-value systems such as

  • AWS: Secure Systems Manager
  • GitLab: CI-CD
  • etcd (Open-Source)
  • Hasicorp: Vault
  • GitHub: Actions

Usage

In order to generate a new package, open a shell and issue the following:

cargo run --bin parser -- --help

Cargo

Cargo: The Rust build tool and package manager.

rustup ships with the latest, stable version of the Rust build tool and package manager, also known as Cargo. Usage:

  • Install: cargo install --path "."

  • Build Package: cargo build

  • Run Program: cargo run

  • Test Runtime: cargo test

  • Documentation: cargo doc

  • Publish Crate: cargo publish

Nightly

  • Install: cargo install --path "."

  • Build Package: cargo +nightly build

  • Run Program: cargo +nightly run

  • Test Runtime: cargo +nightly test

  • Documentation: cargo +nightly doc

  • Publish Crate: cargo +nightly publish

To check the current version of cargo, run cargo --version


Examples

cargo +nightly run --bin example-cli -- --help

References


cargo +nightly run --package Schema-Serialization --bin Schema-Serialization

Git Module(s)

YAML

git submodule add --force "https://github.com/dtolnay/serde-yaml.git" ./Modules/YAML

To remove the submodule,

git submodule deinit --force ./Modules/YAML

JSON-Serialization

git submodule add --force "https://github.com/serde-rs/json.git" ./Modules/JSON

To remove the submodule,

git submodule deinit --force ./Modules/JSON

JSON-Serialization Benchmarks

git submodule add --force "https://github.com/serde-rs/json-benchmark.git" ./Modules/JSON-Benchmarks

To remove the submodule,

git submodule deinit --force ./Modules/JSON-Benchmarks

Git-C

git submodule add --force "https://github.com/rust-lang/git2-rs.git" ./Modules/Git-C-Bindings

To remove the submodule,

git submodule deinit --force ./Modules/Git-C-Bindings