From c1d21151ec9d18e5156f4124cf9c323a051b2c47 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 22 Nov 2021 21:19:01 +0100 Subject: [PATCH] port to clap 3.0.0-beta.5 --- 0001-port-to-clap-3.0.0-beta.5.patch | 66 ++++++++++++++++++++++++++++ rust-dua-cli.spec | 7 ++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 0001-port-to-clap-3.0.0-beta.5.patch diff --git a/0001-port-to-clap-3.0.0-beta.5.patch b/0001-port-to-clap-3.0.0-beta.5.patch new file mode 100644 index 0000000..bec2222 --- /dev/null +++ b/0001-port-to-clap-3.0.0-beta.5.patch @@ -0,0 +1,66 @@ +From 946a6a3547d1f6ca7347bed9d77c750d686ad505 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Mon, 22 Nov 2021 20:58:46 +0100 +Subject: [PATCH] port to clap 3.0.0-beta.5 + +--- + src/main.rs | 2 +- + src/options.rs | 11 +++++------ + 2 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/src/main.rs b/src/main.rs +index d45672f..0b86049 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -1,6 +1,6 @@ + #![forbid(unsafe_code)] + use anyhow::Result; +-use clap::Clap; ++use clap::Parser; + use dua::{ByteFormat, TraversalSorting}; + use std::{fs, io, io::Write, path::PathBuf, process}; + +diff --git a/src/options.rs b/src/options.rs +index d8167c5..dce3af6 100644 +--- a/src/options.rs ++++ b/src/options.rs +@@ -1,4 +1,4 @@ +-use clap::Clap; ++use clap::Parser; + use dua::ByteFormat as LibraryByteFormat; + use std::path::PathBuf; + use std::str::FromStr; +@@ -50,10 +50,9 @@ impl From for LibraryByteFormat { + } + } + +-#[derive(Debug, Clap)] ++#[derive(Debug, Parser)] + #[clap(name = "dua", about = "A tool to learn about disk usage, fast!", version = clap::crate_version!())] +-#[clap(setting = clap::AppSettings::ColoredHelp)] +-#[clap(setting = clap::AppSettings::GlobalVersion)] ++#[clap(setting = clap::AppSettings::PropagateVersion)] + #[clap(override_usage = "dua [FLAGS] [OPTIONS] [SUBCOMMAND] [input]...")] + pub struct Args { + #[clap(subcommand)] +@@ -85,7 +84,7 @@ pub struct Args { + /// GiB - only gibibytes + /// MB - only megabytes + /// MiB - only mebibytes +- #[clap(short = 'f', long, case_insensitive = true, possible_values(&ByteFormat::VARIANTS))] ++ #[clap(short = 'f', long, case_insensitive = true, possible_values(ByteFormat::VARIANTS))] + pub format: Option, + + /// Display apparent size instead of disk usage. +@@ -105,7 +104,7 @@ pub struct Args { + pub input: Vec, + } + +-#[derive(Debug, Clap)] ++#[derive(Debug, Parser)] + pub enum Command { + /// Launch the terminal user interface + #[cfg(any(feature = "tui-unix", feature = "tui-crossplatform"))] +-- +2.33.1 + diff --git a/rust-dua-cli.spec b/rust-dua-cli.spec index e645426..f179027 100644 --- a/rust-dua-cli.spec +++ b/rust-dua-cli.spec @@ -6,7 +6,7 @@ Name: rust-%{crate} Version: 2.11.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tool to conveniently learn about the disk usage of directories # Upstream license specification: MIT @@ -18,6 +18,8 @@ Source: %{crates_source} # * bump tui from 0.14 to 0.15 # * bump tui-react from 0.14 to 0.15 Patch0: dua-cli-fix-metadata.diff +# * port to clap 3.0.0-beta.5 +Patch1: 0001-port-to-clap-3.0.0-beta.5.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -191,6 +193,9 @@ which use "unicode-segmentation" feature of "%{crate}" crate. %endif %changelog +* Mon Nov 22 2021 Fabio Valentini - 2.11.1-5 +- Port to clap 3.0.0-beta.5. + * Mon Aug 23 2021 Fabio Valentini - 2.11.1-4 - Bump tui, tui-react, and crosstermion versions.