App-IODUtils
view release on metacpan or search on metacpan
script/delete-iod-section view on Meta::CPAN
@sections = grep { /$re/ } $doc->list_sections(unique => 1);
}
for (@sections) {
$doc->delete_section(
{
all => $args{all},
},
$_,
);
}
App::IODUtils::_return_mod_result(\%args, $doc);
}
Perinci::CmdLine::Any->new(
url => '/main/delete_iod_section',
read_config => 0,
read_env => 0,
)->run;
# ABSTRACT: Delete a section (and its contents) from IOD configuration file
# PODNAME: delete-iod-section
__END__
=pod
=encoding UTF-8
=head1 NAME
delete-iod-section - Delete a section (and its contents) from IOD configuration file
=head1 VERSION
This document describes version 0.164 of delete-iod-section (from Perl distribution App-IODUtils), released on 2024-06-24.
=head1 SYNOPSIS
Basic usage:
% delete-iod-section /path/to/file.iod section
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--all>
Delete all occurrences instead of just the first.
=item B<--inplace>
Modify file in-place.
Note that this can only be done if you specify an actual file and not STDIN.
Otherwise, an error will be thrown.
=item B<--section-pattern>=I<s>
Regex to match section name.
=item B<--section>=I<s>
Section name.
Can also be specified as the 2nd command-line argument.
=back
=head2 Output options
=over
=item B<--format>=I<s>
Choose output format, e.g. json, text.
Default value:
undef
Output can be displayed in multiple formats, and a suitable default format is
chosen depending on the application and/or whether output destination is
interactive terminal (i.e. whether output is piped). This option specifically
chooses an output format.
=item B<--json>
Set output format to json.
=item B<--naked-res>
When outputing as JSON, strip result envelope.
Default value:
0
By default, when outputing as JSON, the full enveloped result is returned, e.g.:
[200,"OK",[1,2,3],{"func.extra"=>4}]
The reason is so you can get the status (1st element), status message (2nd
element) as well as result metadata/extra result (4th element) instead of just
the result (3rd element). However, sometimes you want just the result, e.g. when
you want to pipe the result for more post-processing. In this case you can use
C<--naked-res> so you just get:
[1,2,3]
=item B<--page-result>
Filter output through a pager.
( run in 0.570 second using v1.01-cache-2.11-cpan-39bf76dae61 )