From 3edc432a60a5db633351a52f1adbcdd0ee1ff838 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 24 May 2019 23:25:49 -0400 Subject: Add documentation for -xattr --- bfs.1 | 13 ++++++++----- parse.c | 12 ++++++++---- tests.sh | 6 ++++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/bfs.1 b/bfs.1 index a67c254..69f22f9 100644 --- a/bfs.1 +++ b/bfs.1 @@ -270,9 +270,8 @@ Turn on or off warnings about the command line. .SH TESTS .TP .B \-acl -Find files with non-trivial -.BR acl (5) -(Access Control Lists). +Find files with a non-trivial Access Control List +.RB ( acl (5)). .PP \fB\-amin\fR [\fI\-+\fR]\fIN\fR .br @@ -318,7 +317,7 @@ days ago. .RE .TP .B \-capable -Match files with POSIX.1e +Find files with POSIX.1e .BR capabilities (7) set. .TP @@ -366,7 +365,7 @@ Find files owned by the group/user .RE .TP .B \-hidden -Match hidden files (those beginning with +Find hidden files (those beginning with .IR . ). .PP \fB\-ilname \fIGLOB\fR @@ -480,6 +479,10 @@ Find files last accessed .I N days after they were changed. .TP +.B \-xattr +Find files with extended attributes +.RB ( xattr (7)). +.TP \fB\-xtype\fR [\fIbcdlpfswD\fR] Find files of the given type, following links when .B \-type diff --git a/parse.c b/parse.c index 4379e7a..77bfbc7 100644 --- a/parse.c +++ b/parse.c @@ -2434,7 +2434,7 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) { cfprintf(cout, " ${blu}-regextype${rs} ${bld}TYPE${rs}\n"); cfprintf(cout, " Use ${bld}TYPE${rs}-flavored regexes (default: ${bld}posix-basic${rs}; see ${blu}-regextype${rs}" " ${bld}help${rs})\n"); - cfprintf(cout, " ${blu}-unique{rs}\n"); + cfprintf(cout, " ${blu}-unique${rs}\n"); cfprintf(cout, " Skip any files that have already been seen\n"); cfprintf(cout, " ${blu}-warn${rs}\n"); cfprintf(cout, " ${blu}-nowarn${rs}\n"); @@ -2444,7 +2444,7 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) { #if BFS_CAN_CHECK_ACL cfprintf(cout, " ${blu}-acl${rs}\n"); - cfprintf(cout, " Find files with non-trivial Access Control Lists\n"); + cfprintf(cout, " Find files with a non-trivial Access Control List\n"); #endif cfprintf(cout, " ${blu}-${rs}[${blu}aBcm${rs}]${blu}min${rs} ${bld}[-+]N${rs}\n"); cfprintf(cout, " Find files ${blu}a${rs}ccessed/${blu}B${rs}irthed/${blu}c${rs}hanged/${blu}m${rs}odified ${bld}N${rs} minutes ago\n"); @@ -2455,7 +2455,7 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) { cfprintf(cout, " Find files ${blu}a${rs}ccessed/${blu}B${rs}irthed/${blu}c${rs}hanged/${blu}m${rs}odified ${bld}N${rs} days ago\n"); #if BFS_CAN_CHECK_CAPABILITIES cfprintf(cout, " ${blu}-capable${rs}\n"); - cfprintf(cout, " Match files with POSIX.1e capabilities set\n"); + cfprintf(cout, " Find files with POSIX.1e capabilities set\n"); #endif cfprintf(cout, " ${blu}-depth${rs} ${bld}[-+]N${rs}\n"); cfprintf(cout, " Find files with depth ${bld}N${rs}\n"); @@ -2478,7 +2478,7 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) { cfprintf(cout, " Find files owned by the group/user ${bld}NAME${rs}\n"); cfprintf(cout, " ${blu}-hidden${rs}\n"); cfprintf(cout, " ${blu}-nohidden${rs}\n"); - cfprintf(cout, " Match hidden files, or filter them out\n"); + cfprintf(cout, " Find hidden files, or filter them out\n"); #ifdef FNM_CASEFOLD cfprintf(cout, " ${blu}-ilname${rs} ${bld}GLOB${rs}\n"); cfprintf(cout, " ${blu}-iname${rs} ${bld}GLOB${rs}\n"); @@ -2523,6 +2523,10 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) { cfprintf(cout, " Find files of the given type\n"); cfprintf(cout, " ${blu}-used${rs} ${bld}[-+]N${rs}\n"); cfprintf(cout, " Find files last accessed ${bld}N${rs} days after they were changed\n"); +#if BFS_CAN_CHECK_XATTRS + cfprintf(cout, " ${blu}-xattr${rs}\n"); + cfprintf(cout, " Find files with extended attributes\n"); +#endif cfprintf(cout, " ${blu}-xtype${rs} ${bld}[bcdlpfswD]${rs}\n"); cfprintf(cout, " Find files of the given type, following links when ${blu}-type${rs} would not, and\n"); cfprintf(cout, " vice versa\n\n"); diff --git a/tests.sh b/tests.sh index bec7022..75319d7 100755 --- a/tests.sh +++ b/tests.sh @@ -618,6 +618,8 @@ bfs_tests=( test_execdir_plus + test_help + test_hidden test_nohidden @@ -2378,6 +2380,10 @@ function test_L_xattr() { bfs_diff -L scratch -xattr } +function test_help() { + ! invoke_bfs -help | grep -E '\{...?\}' +} + BOL= EOL='\n' -- cgit v1.2.3