From 9b30634a234659c7dd87073c00affdcdec74c5ed Mon Sep 17 00:00:00 2001
From: Tavian Barnes <tavianator@tavianator.com>
Date: Tue, 20 Dec 2016 22:05:21 -0500
Subject: Add some text to the -help output

---
 parse.c | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/parse.c b/parse.c
index 1697b7b..7f656c3 100644
--- a/parse.c
+++ b/parse.c
@@ -1736,11 +1736,37 @@ static struct expr *parse_warn(struct parser_state *state, int warn, int arg2) {
  * "Parse" -help.
  */
 static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) {
-	printf("Usage: %s [arguments...]\n\n", state->command);
+	printf("Usage: %s [flags...] [paths...] [expression...]\n\n", state->command);
 
 	printf("bfs is compatible with find; see find -help or man find for help with find-\n"
 	       "compatible options :)\n\n");
 
+	printf("flags (-H/-L/-P etc.), paths, and expressions may be freely mixed in any order.\n\n");
+
+	printf("POSIX find features:\n");
+	printf("  ( EXPRESSION )\n");
+	printf("  ! EXPRESSION\n");
+	printf("  EXPRESSION [-a] EXPRESSION\n");
+	printf("  EXPRESSION -o EXPRESSION\n\n");
+	printf("  -H, -L, -name, -path, -xdev, -prune, -perm, -type, -links, -user, -group,\n");
+	printf("  -size, -atime, -ctime, -mtime, -exec ... ;, -ok ... ;, -print, -newer, -depth\n\n");
+
+	printf("GNU find features:\n");
+	printf("  -not EXPRESSION\n");
+	printf("  EXPRESSION -and EXPRESSION\n");
+	printf("  EXPRESSION -or EXPRESSION\n");
+	printf("  EXPRESSION , EXPRESSION\n\n");
+	printf("  -P, -D, -O, -daystart, -follow, -regextype, -warn, -nowarn, -d, -maxdepth,\n");
+	printf("  -mindepth, -mount, -noleaf, -ignore_readdir_race, -noignore_readdir_race,\n");
+	printf("  -amin, -anewer, -cmin, -cnewer, -mmin, -empty, -false, -gid, -ilname, -iname,\n");
+	printf("  -inum, -ipath, -iwholename, -iregex, -lname, -newerXY, -wholename, -regex,\n");
+	printf("  -readable, -writable, -executable, -samefile, -true, -uid, -used, -xtype,\n");
+	printf("  -delete, -execdir ... ;, -okdir ... ;, -print0, -fprint, -fprint0, -quit,\n");
+	printf("  -help, -version\n\n");
+
+	printf("BSD find features:\n");
+	printf("  -E, -d, -x, -depth N, -gid NAME, -uid NAME, -size N[ckMGTP], -sparse\n\n");
+
 	printf("Extra features:\n"
 	       "  -color, -nocolor: Turn on or off file type colorization.\n\n"
 	       "  -hidden, -nohidden: Match hidden files, or filter them out.\n\n");
-- 
cgit v1.2.3