Compare commits

...

3 commits
state ... main

Author SHA1 Message Date
05e1bd48e0 errors now write to stderr instead of stdout 2024-07-12 10:49:46 -04:00
6a9bbe664a updated README 2024-07-06 21:18:15 -04:00
b1c32ff6f0 removed unused imports 2024-07-06 21:14:41 -04:00
4 changed files with 13 additions and 12 deletions

View file

@ -46,6 +46,13 @@ using an AUR package manager such as <a href="https://github.com/Morganamilo/par
Install the package using Cargo with the command <code>cargo install pride-term</code>. Install the package using Cargo with the command <code>cargo install pride-term</code>.
</details> </details>
### Man Page
<details>
<summary>Section 6</summary>
Copy <code>man/pride.6</code> into <code>/usr/share/man/man6/</code>.
</details>
## Libraries ## Libraries
- [pico-args](https://crates.io/crates/pico-args) — argument parsing - [pico-args](https://crates.io/crates/pico-args) — argument parsing

View file

@ -1,10 +1,6 @@
//! flags that require more complex rendering than just scaling colored stripes //! flags that require more complex rendering than just scaling colored stripes
use termion::{ use termion::color::{ Bg, Rgb };
terminal_size,
color::{ Bg, Rgb }
};
use crate::{ use crate::{
color::*, color::*,

View file

@ -6,13 +6,11 @@ use std::io::{
}; };
use termion::{ use termion::{
terminal_size,
clear, clear,
color::{ Bg, Fg, Rgb }, color::{ Bg, Fg, Rgb },
cursor, cursor,
input::TermRead, input::TermRead,
raw::{ RawTerminal, IntoRawMode } raw::IntoRawMode
}; };
use crate::{ use crate::{

View file

@ -1,24 +1,24 @@
use std::process::exit; use std::process::exit;
pub fn unmatched_flag(target: String) { pub fn unmatched_flag(target: String) {
println!("pride: no flag {target}"); eprintln!("pride: no flag {target}");
exit(1); exit(1);
} }
pub fn size_missing() { pub fn size_missing() {
println!("pride: size flag requires a value"); eprintln!("pride: size flag requires a value");
exit(2); exit(2);
} }
pub fn size_error(value: &str) { pub fn size_error(value: &str) {
println!("pride: size '{value}' is invalid"); eprintln!("pride: size '{value}' is invalid");
exit(2); exit(2);
} }
pub fn too_small(width: u16, height: u16) { pub fn too_small(width: u16, height: u16) {
println!("pride: this flag must be bigger than {width}x{height}"); eprintln!("pride: this flag must be bigger than {width}x{height}");
exit(3); exit(3);
} }