Commit 43caf1a6 authored by Tomasz Warniełło's avatar Tomasz Warniełło Committed by Jonathan Corbet
Browse files

scripts: kernel-doc: Relink argument parsing error handling to pod2usage



The former usage function is substituted, although not as the -h and -help
parameter handler yet.

Purpose: Use Pod::Usage to handle documentation printing in an integrated
way.

Signed-off-by: default avatarTomasz Warniełło <tomasz.warniello@gmail.com>
Tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Disliked-by: default avatarAkira Yokosawa <akiyks@gmail.com>
Link: https://lore.kernel.org/r/20220218181628.1411551-3-tomasz.warniello@gmail.com


Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent a5cdaea5
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -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;
@@ -519,7 +527,13 @@ while ($ARGV[0] =~ m/^--?(.*)/) {
	}
    } else {
		# Unknown argument
        usage();
		pod2usage(
			-message => "Argument unknown!\n",
			-exitval => 1,
			-verbose => 99,
			-sections => 'SYNOPSIS',
			-output => \*STDERR,
		);
    }
}