made size flag change non-breaking and adjusted version
This commit is contained in:
parent
7cecac36ee
commit
0c1c1148c2
4 changed files with 13 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "pride"
|
||||
version = "1.0.0"
|
||||
version = "0.4.1"
|
||||
edition = "2021"
|
||||
authors = [ "Valerie Wolfe <sleeplessval@gmail.com>" ]
|
||||
description = "Pride flags in the terminal."
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl hlv
|
||||
.Op Fl s Ar size
|
||||
.Op Fl s Op Ar size
|
||||
.Op Ar flag
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
|
@ -18,8 +18,8 @@ displays pride flags in the terminal using ANSI truecolor sequences.
|
|||
Shows a brief help text.
|
||||
.It Fl l , Fl -list
|
||||
Shows a list of available pride flags.
|
||||
.It Fl s , Fl -size Ar size
|
||||
Scales the flag to the given size: 'small' will produce the minimum size; one number sets the width; and two numbers separated by 'x' sets width and height respectively.
|
||||
.It Fl s , Fl -size Op Ar size
|
||||
Scales the flag to the given size: no value or 'small' will produce the minimum size; one number sets the width; and two numbers separated by 'x' sets width and height respectively.
|
||||
.It Fl v , Fl -version
|
||||
Shows version information.
|
||||
.It Ar flag
|
||||
|
|
|
@ -19,7 +19,7 @@ flags:
|
|||
-h, --help Shows this help text
|
||||
--version Show version information
|
||||
-l, --list Prints a list of printable flags
|
||||
-s, --size <size> Sets the size of the output flag.
|
||||
-s, --size [size] Sets the size of the output flag.
|
||||
|
||||
Use 'pride --list' to see a list of printable flags
|
||||
|
||||
|
|
|
@ -51,8 +51,12 @@ impl State {
|
|||
|
||||
let size = match args.value_from_str::<[&str;2], String>(FLAG_SIZE).as_deref() {
|
||||
Ok(value) => Size::from(value),
|
||||
|
||||
Err(Error::MissingOption(_)) |
|
||||
Err(Error::MissingArgument) => if is_terminal { Size::Full } else { Size::Small },
|
||||
|
||||
Err(Error::OptionWithoutAValue(_)) => Size::Small,
|
||||
|
||||
_ => { error::size_missing(); panic!() }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue