~elchenberg/not-envsubst

ref: f4ab9be4f33746392bb68bbc614cd1283a7dc474 not-envsubst/src/main.rs -rw-r--r-- 502 bytes
f4ab9be4elchenberg Initial commit 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#![forbid(unsafe_code)]
#![warn(clippy::all)]
#![warn(clippy::pedantic)]

mod cli;
mod tpl;
mod pkg;
mod stdin;

fn main() {
    let args = crate::cli::get_args();

    if args.help {
        crate::cli::print_help_and_exit();
    }

    if args.version {
        crate::cli::print_version_and_exit();
    }

    let input: Vec<String> = crate::stdin::get_lines_or_exit();
    let output: Vec<String> = crate::tpl::replace_variables(input);
    for line in output {
        print!("{}", line);
    }
}