Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
05e1bd48e0 | |||
6a9bbe664a | |||
b1c32ff6f0 |
4 changed files with 13 additions and 12 deletions
|
@ -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
|
||||||
|
|
|
@ -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::*,
|
||||||
|
|
|
@ -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::{
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue