mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
prose: update to 0.4.2.
This commit is contained in:
parent
ad816275e4
commit
0b2934491b
2 changed files with 3 additions and 59 deletions
|
@ -1,56 +0,0 @@
|
||||||
From 037bf5b8e14fc0b8b25e00e2e076515148860825 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Joshua Davey <josh@joshuadavey.com>
|
|
||||||
Date: Sat, 10 Dec 2022 16:28:29 -0500
|
|
||||||
Subject: [PATCH] Use usize parser from clap
|
|
||||||
|
|
||||||
---
|
|
||||||
src/main.rs | 13 +++++++------
|
|
||||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/main.rs b/src/main.rs
|
|
||||||
index efb0420..fb0e8ad 100644
|
|
||||||
--- a/src/main.rs
|
|
||||||
+++ b/src/main.rs
|
|
||||||
@@ -29,16 +29,14 @@ fn process_paragraphs<R: BufRead + ?Sized>(io: &mut R, opts: FormatOpts) -> io::
|
|
||||||
|
|
||||||
fn matches_to_format_opts(matches: &clap::ArgMatches) -> FormatOpts {
|
|
||||||
let width: usize = matches
|
|
||||||
- .get_one::<&str>("width")
|
|
||||||
- .unwrap()
|
|
||||||
- .parse()
|
|
||||||
+ .get_one::<usize>("width")
|
|
||||||
+ .cloned()
|
|
||||||
.expect("Choose a positive number for width");
|
|
||||||
let last_line = matches.get_flag("last line");
|
|
||||||
let reduce_jaggedness = matches.get_flag("better fit");
|
|
||||||
let tab_width: usize = matches
|
|
||||||
- .get_one::<&str>("tab width")
|
|
||||||
- .unwrap()
|
|
||||||
- .parse()
|
|
||||||
+ .get_one::<usize>("tab width")
|
|
||||||
+ .cloned()
|
|
||||||
.expect("Choose a positive number for tab width");
|
|
||||||
let format_mode = if matches.get_flag("markdown") {
|
|
||||||
FormatMode::Markdown
|
|
||||||
@@ -71,6 +69,7 @@ fn main() {
|
|
||||||
.short('w')
|
|
||||||
.long("width")
|
|
||||||
.value_name("WIDTH")
|
|
||||||
+ .value_parser(clap::value_parser!(usize))
|
|
||||||
.default_value("72")
|
|
||||||
.help("Sets the maximum width for a line"))
|
|
||||||
.arg(Arg::new("last line")
|
|
||||||
@@ -86,11 +85,13 @@ fn main() {
|
|
||||||
.arg(Arg::new("tab width")
|
|
||||||
.short('t')
|
|
||||||
.long("tab-width")
|
|
||||||
+ .value_parser(clap::value_parser!(usize))
|
|
||||||
.default_value("4")
|
|
||||||
.help("Number of spaces to expand tab characters to"))
|
|
||||||
.arg(Arg::new("markdown")
|
|
||||||
.short('m')
|
|
||||||
.long("markdown")
|
|
||||||
+ .conflicts_with("code comments")
|
|
||||||
.help("Parse as markdown rather than plain text")
|
|
||||||
.action(ArgAction::SetTrue))
|
|
||||||
.arg(Arg::new("FILE")
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Template file for 'prose'
|
# Template file for 'prose'
|
||||||
pkgname=prose
|
pkgname=prose
|
||||||
version=0.4.0
|
version=0.4.2
|
||||||
revision=2
|
revision=1
|
||||||
build_style=cargo
|
build_style=cargo
|
||||||
short_desc="Reformat text pleasantly"
|
short_desc="Reformat text pleasantly"
|
||||||
maintainer="Leah Neukirchen <leah@vuxu.org>"
|
maintainer="Leah Neukirchen <leah@vuxu.org>"
|
||||||
license="MIT, Apache-2.0"
|
license="MIT, Apache-2.0"
|
||||||
homepage="https://github.com/jgdavey/prose/"
|
homepage="https://github.com/jgdavey/prose/"
|
||||||
distfiles="https://github.com/jgdavey/prose/archive/v${version}.tar.gz"
|
distfiles="https://github.com/jgdavey/prose/archive/v${version}.tar.gz"
|
||||||
checksum=ab6409b1ad1cb6b19b5f2dba5c4d3c8bc3cbe8923c8dfb64a790ac93d3e86c36
|
checksum=84dbec8a1616096e8ccf1b9a8669943465f680656de0dd99c47c7ff2088ed243
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vlicense LICENSE-MIT
|
vlicense LICENSE-MIT
|
||||||
|
|
Loading…
Add table
Reference in a new issue