-sub print_simple_pod_manpage {
- my ($podfn, $class, $name, $arg_param, $uri_param) = @_;
-
- die "not initialized" if !$cli_handler_class;
-
- my $pwcallback = $cli_handler_class->can('read_password');
-
- my $synopsis = " $name help\n\n";
- my $str = $class->usage_str($name, $name, $arg_param, $uri_param, 'long', $pwcallback);
- $str =~ s/^USAGE://;
- $str =~ s/\n/\n /g;
- $synopsis .= $str;
-
- my $parser = PVE::PodParser->new();
- $parser->{include}->{synopsis} = $synopsis;
- $parser->parse_from_file($podfn);
-}
-
-sub print_pod_manpage {
- my ($podfn) = @_;
-
- die "not initialized" if !($cmddef && $exename && $cli_handler_class);
- die "no pod file specified" if !$podfn;
-
- my $pwcallback = $cli_handler_class->can('read_password');
-
- my $synopsis = "";
-
- $synopsis .= " $exename <COMMAND> [ARGS] [OPTIONS]\n\n";
-
- my $style = 'full'; # or should we use 'short'?
- my $oldclass;
- foreach my $cmd (sorted_commands()) {
- my ($class, $name, $arg_param, $uri_param) = @{$cmddef->{$cmd}};
- my $str = $class->usage_str($name, "$exename $cmd", $arg_param,
- $uri_param, $style, $pwcallback);
- $str =~ s/^USAGE: //;
-
- $synopsis .= "\n" if $oldclass && $oldclass ne $class;
- $str =~ s/\n/\n /g;
- $synopsis .= " $str\n\n";
- $oldclass = $class;
- }
-
- $synopsis .= "\n";
-
- my $parser = PVE::PodParser->new();
- $parser->{include}->{synopsis} = $synopsis;
- $parser->parse_from_file($podfn);
-}
-