From b905f12e681b3dd8fd690869128dc8456a7f7294 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 4 Feb 2025 16:47:02 -0500 Subject: bsgrep: remove -h option, fix synopsis, document use of -d with >1 character. --- bsgrep | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'bsgrep') diff --git a/bsgrep b/bsgrep index 6521d58..5422448 100755 --- a/bsgrep +++ b/bsgrep @@ -50,7 +50,7 @@ sub grep_options { } @ARGV = @nargv; - getopts('d:FhiklnNqrsvwz', \%opt) || exit 1; + getopts('d:FiklnNqrsvwz', \%opt) || exit 1; } sub print_line { @@ -60,14 +60,8 @@ sub print_line { print $opt{z} ? "\0" : "\n"; } -sub join_help { - print "usage: $self [--help | --version | -[knwz] [-d char] ...] [ ...]\n"; - exit 0; -} - sub join_options { - getopts('hd:knwz', \%opt) || exit 1; - join_help() if $opt{h}; + getopts('d:knwz', \%opt) || exit 1; } sub handle_line { @@ -214,9 +208,9 @@ bsjoin - join lines with backslash continuation =head1 SYNOPSIS -bsgrep [B<[-hknwz]> B<-d> I I<...>] [B<-e> I ... | I] [I I<...>] +bsgrep [B<[-FiklnNqrsvwz]> B<-d> I I<...>] [B<-e> I ... | I] [I I<...>] -bsjoin [B<[-hiklnqrsvwz]> B<-d> I I<...>] [I I<...>] +bsjoin [B<[-knwz]> B<-d> I I<...>] [I I<...>] =head1 DESCRIPTION @@ -237,7 +231,7 @@ match text split across continuation lines. If B is run as B (via symbolic or hard link, or just copying the executable), it will simply join together continued lines without searching for anything. In this mode, only the B<-k>, B<-n>, -B<-w>, B<-h>, B<--version>, and B<--help> options are supported. +B<-w>, B<--version>, and B<--help> options are supported. =head1 OPTIONS @@ -248,6 +242,9 @@ These options work with both B and B: =item -d I Use I as the continuation character, rather than a backslash. +Actually, there's no law that says it has to be a single character, +if you can think of a use for a string here... though it's treated as +a fixed string, not a regular expression. =item -k -- cgit v1.2.3