lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o8362yab.fsf@meer.lwn.net>
Date:   Wed, 16 Feb 2022 16:21:16 -0700
From:   Jonathan Corbet <corbet@....net>
To:     Tomasz Warniełło <tomasz.warniello@...il.com>
Cc:     Tomasz Warniełło <tomasz.warniello@...il.com>,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 03/15] scripts: kernel-doc: Relink argument parsing
 error handling to pod2usage

Tomasz Warniełło <tomasz.warniello@...il.com> writes:

> The former usage function is substituted, although not as the -h and -help
> parameter handler yet.
>
> * Transform documentation into POD (3/15)
> See step 1 for the series details.

Again, this doesn't belong here; I'll not mention it for the following
patches. 

> Signed-off-by: Tomasz Warniełło <tomasz.warniello@...il.com>
> ---
>  scripts/kernel-doc | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index c8fbf1d3d5aa..c37fd36860f3 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -16,6 +16,8 @@ use strict;
>  ## This software falls under the GNU General Public License.     ##
>  ## Please read the COPYING file for more information             ##
>  
> +use Pod::Usage qw/pod2usage/;
> +
>  =head1 NAME
>  
>  kernel-doc - Print formatted kernel documentation to stdout
> @@ -298,7 +300,13 @@ my $blankline_rst = "\n";
>  
>  # read arguments
>  if ($#ARGV == -1) {
> -    usage();
> +	pod2usage(
> +		-message => "No arguments!\n",
> +		-exitval => 1,
> +		-verbose => 99,
> +		-sections => 'SYNOPSIS',
> +		-output => \*STDERR,
> +	);
>  }
>  
>  my $kernelversion;
> @@ -518,8 +526,14 @@ while ($ARGV[0] =~ m/^--?(.*)/) {
>  	    die "Sphinx version should either major.minor or major.minor.patch format\n";
>  	}
>      } else {
> -	# Unknown argument
> -        usage();
> +			# Unknown argument
> +		pod2usage(
> +			-message => "Argument unknown!\n",
> +			-exitval => 1,
> +			-verbose => 99,
> +			-sections => 'SYNOPSIS',
> +			-output => \*STDERR,
> +		);

So you were asked before to retain the existing style, including
indentations.

Thanks,

jon

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ