barcode-gen 0.1.0

A simple Code128 barcode generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::process::exit;

fn main() {
    let text = std::env::args()
        .skip(1)
        .fold(String::new(), |acc, c| format!("{acc} {c}"));
    if text.is_empty() {
        println!("You might want to add some arguments to encode...");
        exit(1)
    }
    if let Some(code) = barcode_gen::make_barcode(&text) {
        println!("{code}");
    }
}