New package: ouch-0.3.1
This commit is contained in:
parent
ed216f183a
commit
b9222e94bc
3 changed files with 110 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
From 60763a64c1b7268050bb61fb8cef1c982bbd4aca Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
|
||||
<jan.christian@gruenhage.xyz>
|
||||
Date: Sun, 13 Feb 2022 09:53:28 +0100
|
||||
Subject: [PATCH 1/2] chore: allow overriding the completions output directory
|
||||
|
||||
---
|
||||
build.rs | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/build.rs b/build.rs
|
||||
index 5372154..b5c56c4 100644
|
||||
--- a/build.rs
|
||||
+++ b/build.rs
|
||||
@@ -1,7 +1,7 @@
|
||||
use clap::{ArgEnum, IntoApp};
|
||||
use clap_generate::{generate_to, Shell};
|
||||
|
||||
-use std::{env, fs::create_dir_all, path::Path};
|
||||
+use std::{env, fs::create_dir_all};
|
||||
|
||||
include!("src/opts.rs");
|
||||
|
||||
@@ -12,7 +12,13 @@ fn main() {
|
||||
return;
|
||||
}
|
||||
|
||||
- let out = &Path::new(&env::var_os("OUT_DIR").unwrap()).join("completions");
|
||||
+ let out = &env::var_os("OUCH_COMPLETIONS_DIR")
|
||||
+ .map(|path| PathBuf::from(&path))
|
||||
+ .or_else(|| env::var_os("OUT_DIR")
|
||||
+ .map(|path| PathBuf::from(&path))
|
||||
+ .map(|path| path.join("completions"))
|
||||
+ ).unwrap();
|
||||
+
|
||||
create_dir_all(out).unwrap();
|
||||
let app = &mut Opts::into_app();
|
||||
|
||||
--
|
||||
2.35.1
|
|
@ -0,0 +1,46 @@
|
|||
From b6279d75db53ddc34dd6ba727df1b7fd0ad134dd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
|
||||
<jan.christian@gruenhage.xyz>
|
||||
Date: Sun, 13 Feb 2022 10:09:29 +0100
|
||||
Subject: [PATCH 2/2] fix: remove single quotes from clap doc comments
|
||||
|
||||
Apparently, clap_complete doesn't properly escape single quotes in doc
|
||||
comments, leading to broken shell completions for zsh. To circumvent
|
||||
this, I've removed the single quote in the one place where it shouldn't
|
||||
have been in the first place ("it's" vs "its", contraction vs possessive
|
||||
pronoun), and replaced "it's" with "it is" in the other place.
|
||||
|
||||
Reference to upstream issue: https://github.com/clap-rs/clap/issues/1596
|
||||
---
|
||||
src/commands.rs | 2 +-
|
||||
src/opts.rs | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/commands.rs b/src/commands.rs
|
||||
index 106e36d..692dceb 100644
|
||||
--- a/src/commands.rs
|
||||
+++ b/src/commands.rs
|
||||
@@ -99,7 +99,7 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> {
|
||||
let output_file = fs::File::create(&output_path)?;
|
||||
|
||||
if !represents_several_files(&files) {
|
||||
- // It's possible the file is already partially compressed so we don't want to compress it again
|
||||
+ // It is possible the file is already partially compressed so we don't want to compress it again
|
||||
// `ouch compress file.tar.gz file.tar.gz.xz` should produce `file.tar.gz.xz` and not `file.tar.gz.tar.gz.xz`
|
||||
let input_extensions = extension::extensions_from_path(&files[0]);
|
||||
|
||||
diff --git a/src/opts.rs b/src/opts.rs
|
||||
index 14d6997..e532e7b 100644
|
||||
--- a/src/opts.rs
|
||||
+++ b/src/opts.rs
|
||||
@@ -39,7 +39,7 @@ pub enum Subcommand {
|
||||
#[clap(required = true, min_values = 1)]
|
||||
files: Vec<PathBuf>,
|
||||
|
||||
- /// The resulting file. It's extensions can be used to specify the compression formats.
|
||||
+ /// The resulting file. Its extensions can be used to specify the compression formats.
|
||||
#[clap(required = true, value_hint = ValueHint::FilePath)]
|
||||
output: PathBuf,
|
||||
},
|
||||
--
|
||||
2.35.1
|
24
srcpkgs/ouch/template
Normal file
24
srcpkgs/ouch/template
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Template file for 'ouch'
|
||||
pkgname=ouch
|
||||
version=0.3.1
|
||||
revision=1
|
||||
build_style=cargo
|
||||
makedepends="liblzma-devel bzip2-devel libzip-devel"
|
||||
short_desc="CLI utility for easily compressing and decompressing files and dirs"
|
||||
maintainer="Savoy <savoy@liberation.red>"
|
||||
license="MIT"
|
||||
homepage="https://github.com/ouch-org/ouch"
|
||||
distfiles="https://github.com/ouch-org/ouch/archive/refs/tags/${version}.tar.gz"
|
||||
checksum=269abaf5ac2f80da3796dbf5e73419c1b64104d1295f3ff57965141f079e6f6d
|
||||
|
||||
pre_build() {
|
||||
export GEN_COMPLETIONS=1
|
||||
export OUCH_COMPLETIONS_DIR=completions
|
||||
}
|
||||
|
||||
post_install() {
|
||||
vlicense LICENSE
|
||||
vcompletion "completions/_ouch" zsh
|
||||
vcompletion "completions/ouch.fish" fish
|
||||
vcompletion "completions/ouch.bash" bash
|
||||
}
|
Loading…
Reference in a new issue