barcode-gen 0.3.0

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

fn main() {
    let text = std::env::args().skip(1).fold(String::new(), |acc, c| {
        if acc.is_empty() {
            c
        } else {
            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}");
    }
}