diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-15 01:40:56 +0200 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-05-15 01:44:22 +0200 |
commit | ffbab42883313e6e02d49bf69d7ac2418720c29d (patch) | |
tree | f0b5c9adf0ffe874b27b8bd5480b469bca4b9f80 | |
parent | 713416cfd9db803698fae5f8fd2649d1e93b46d2 (diff) |
grepc, grepc.1: -t...: Allow more granularity
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rwxr-xr-x | bin/grepc | 67 | ||||
-rw-r--r-- | share/man/man1/grepc.1 | 40 |
2 files changed, 105 insertions, 2 deletions
@@ -10,9 +10,18 @@ kflag='no'; tflag='no'; t_enum='no'; t_func='no'; +t_func_proto='no'; +t_func_def='no'; +t_func_syscall='no'; +t_func_syscall_proto='no'; +t_func_syscall_def='no'; t_macro='no'; t_type='no'; t_use='no'; +t_use_enum='yes'; +t_use_func='no'; +t_use_macro='no'; +t_use_type='no'; grepc_usage() @@ -47,6 +56,21 @@ grepc_parse_cmd() f) t_func='yes'; ;; + fp) + t_func_proto='yes'; + ;; + fd) + t_func_def='yes'; + ;; + fs) + t_func_syscall='yes'; + ;; + fsp) + t_func_syscall_proto='yes'; + ;; + fsd) + t_func_syscall_def='yes'; + ;; m) t_macro='yes'; ;; @@ -56,6 +80,18 @@ grepc_parse_cmd() u) t_use='yes'; ;; + ue) + t_use_enum='yes'; + ;; + uf) + t_use_func='yes'; + ;; + um) + t_use_macro='yes'; + ;; + ut) + t_use_type='yes'; + ;; *) grepc_usage; exit 1; @@ -375,13 +411,29 @@ grepc_search() { if [ "$tflag" = 'no' ]; then grepc_search_default "$1"; - else if [ "$t_enum" = 'yes' ]; then grepc_enum_constant "$1"; fi; if [ "$t_func" = 'yes' ]; then grepc_func "$1"; + else + if [ "$t_func_proto" = 'yes' ]; then + grepc_func_proto "$1"; + fi; + if [ "$t_func_def" = 'yes' ]; then + grepc_func_def "$1"; + fi; + if [ "$t_func_syscall" = 'yes' ]; then + grepc_linux_func "$1"; + else + if [ "$t_func_syscall_proto" = 'yes' ]; then + grepc_linux_func_syscall_proto "$1"; + fi; + if [ "$t_func_syscall_def" = 'yes' ]; then + grepc_linux_func_syscall_def "$1"; + fi; + fi; fi; if [ "$t_macro" = 'yes' ]; then grepc_macro "$1"; @@ -391,6 +443,19 @@ grepc_search() fi; if [ "$t_use" = 'yes' ]; then grepc_use "$1"; + else + if [ "$t_use_enum" = 'yes' ]; then + grepc_use_enum "$1"; + fi; + if [ "$t_use_func" = 'yes' ]; then + grepc_use_func "$1"; + fi; + if [ "$t_use_macro" = 'yes' ]; then + grepc_use_macro "$1"; + fi; + if [ "$t_use_type" = 'yes' ]; then + grepc_use_type "$1"; + fi; fi; fi; } diff --git a/share/man/man1/grepc.1 b/share/man/man1/grepc.1 index 25aaa13..b23e5d9 100644 --- a/share/man/man1/grepc.1 +++ b/share/man/man1/grepc.1 @@ -44,6 +44,27 @@ enum constant definitions. .TP .B f Function prototypes and definitions. +This can be further subdivided into: +.RS +.TP +.B fp +Function prototypes. +.TP +.B fd +Function definitions. +.TP +.B fs +Linux kernel system calls. +This can be further subdivided into: +.RS +.TP +.B fsp +Linux kernel system call prototypes. +.TP +.B fsd +Linux kernel system call definitions. +.RE +.RE .TP .B m Macro definitions. @@ -55,11 +76,28 @@ Type definitions. Uses. Searches occurences of .BI \eb identifier \eb -within enums (except as an enum constant), +within enums, function bodies, macro replacements, and type definitions, and prints the whole enum, function, macro, and/or type definitions. +.IP +This can be further subdivided into: +.RS +.TP +.B ue +Uses within enum definitions (except as an enum constant). +.TP +.B uf +Uses within function definition bodies. +.TP +.B um +Uses within macro replacements. +.TP +.B ut +Uses within type definitions +(except enum; that is: typedef, struct, or union). +.RE .SH OPTIONS .TP .B \-g |