!15 FIX tree option not displayed

From: @wave-information_0 
Reviewed-by: @liuzhiqiang26 
Signed-off-by: @liuzhiqiang26
This commit is contained in:
openeuler-ci-bot 2022-07-25 01:52:44 +00:00 committed by Gitee
commit acae5f2f8b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 894f81c355d80445d9117194d458381b73da989f Mon Sep 17 00:00:00 2001
From: xueyamao <xueyamao@kylinos.cn>
Date: Sun, 24 Jul 2022 18:29:29 -0700
Subject: [PATCH]tree:add --du and --prune description in usage()
In usage(), '--du' and "--prune" options are supported,
but the description of them is not given.
So we add --du and --prune description in usage().
Signed-off-by: xueyamao xueyamao@kylinos.cn
---
tree.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tree.c b/tree.c
index a633c57..e235853 100644
--- a/tree.c
+++ b/tree.c
@@ -632,7 +632,7 @@ void usage(int n)
"\t[-L level [-R]] [-P pattern] [-I pattern] [-o filename] [--version]\n"
"\t[--help] [--inodes] [--device] [--noreport] [--nolinks] [--dirsfirst]\n"
"\t[--charset charset] [--filelimit[=]#] [--si] [--timefmt[=]<f>]\n"
- "\t[--sort[=]<name>] [--matchdirs] [--ignore-case] [--fromfile] [--]\n"
+ "\t[--sort[=]<name>] [--matchdirs] [--ignore-case] [--fromfile] [--du] [--prune] [--]\n"
"\t[<directory list>]\n");
if (n < 2) return;
fprintf(stdout,
@@ -653,6 +653,8 @@ void usage(int n)
" --filelimit # Do not descend dirs with more than # files in them.\n"
" --timefmt <f> Print and format time according to the format <f>.\n"
" -o filename Output to file instead of stdout.\n"
+ " --du Print directory sizes.\n"
+ " --prune Prune empty directories from the output.\n"
" ------- File options -------\n"
" -q Print non-printable characters as '?'.\n"
" -N Print non-printable characters as is.\n"
--
1.8.3.1

View File

@ -1,6 +1,6 @@
Name: tree
Version: 1.8.0
Release: 2
Release: 3
Summary: Tree file viewer tool
License: GPLv2+
URL: http://mama.indstate.edu/users/ice/tree/
@ -8,6 +8,8 @@ URL: http://mama.indstate.edu/users/ice/tree/
Source0: ftp://mama.indstate.edu/linux/tree/%{name}-%{version}.tgz
BuildRequires: gcc
# Document --du and --prune options in help output.
Patch0: 0000-Fix-tree-args-option-displayed-incomplete.patch
%description
Tree is a recursive directory listing command that produces a depth indented
@ -44,6 +46,9 @@ install -D -m 644 doc/tree.1 $RPM_BUILD_ROOT%{_mandir}/man1/tree.1
%{_mandir}/man1/*
%changelog
* Tue Jul 12 2022 xueyamao <xueyamao@kylinos.cn> - 1.8.0-3
- DESC: Document --du and --prune options in help output
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.8.0-2
- DESC: delete -S git from %autosetup, and delete BuildRequires git