|
9 | 9 |
|
10 | 10 | use clap::Parser; |
11 | 11 | use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory}; |
| 12 | +use plib::io::input_stream; |
12 | 13 | use plib::lzw::UnixLZWWriter; |
13 | | -use plib::PROJECT_NAME; |
14 | 14 | use std::fs::{self, File}; |
15 | 15 | use std::io::{self, Write}; |
16 | 16 | use std::path::{Path, PathBuf}; |
@@ -49,7 +49,7 @@ fn prompt_user(prompt: &str) -> bool { |
49 | 49 | } |
50 | 50 |
|
51 | 51 | fn compress_file(args: &Args, pathname: &PathBuf) -> io::Result<i32> { |
52 | | - let mut file = plib::io::input_stream(pathname, false)?; |
| 52 | + let mut file = input_stream(pathname, false)?; |
53 | 53 |
|
54 | 54 | let mut encoder = UnixLZWWriter::new(args.bits); |
55 | 55 |
|
@@ -115,11 +115,11 @@ fn compress_file(args: &Args, pathname: &PathBuf) -> io::Result<i32> { |
115 | 115 | } |
116 | 116 |
|
117 | 117 | fn main() -> Result<(), Box<dyn std::error::Error>> { |
118 | | - let mut args = Args::parse(); |
119 | | - |
120 | 118 | setlocale(LocaleCategory::LcAll, ""); |
121 | | - textdomain(PROJECT_NAME)?; |
122 | | - bind_textdomain_codeset(PROJECT_NAME, "UTF-8")?; |
| 119 | + textdomain(env!("PROJECT_NAME"))?; |
| 120 | + bind_textdomain_codeset(env!("PROJECT_NAME"), "UTF-8")?; |
| 121 | + |
| 122 | + let mut args = Args::parse(); |
123 | 123 |
|
124 | 124 | if args.files.is_empty() { |
125 | 125 | args.files.push(PathBuf::new()); |
|
0 commit comments