App-IODUtils
view release on metacpan or search on metacpan
script/delete-iod-key view on Meta::CPAN
my $parser = App::IODUtils::_get_parser(\%args);
my $doc = $parser->read_string($args{iod});
$doc->delete_key(
{
all => $args{all},
},
$args{section}, $args{key},
);
App::IODUtils::_return_mod_result(\%args, $doc);
}
Perinci::CmdLine::Any->new(
url => '/main/delete_iod_key',
read_config => 0,
read_env => 0,
)->run;
# ABSTRACT: Delete a key from IOD configuration file
# PODNAME: delete-iod-key
__END__
=pod
=encoding UTF-8
=head1 NAME
delete-iod-key - Delete a key from IOD configuration file
=head1 VERSION
This document describes version 0.164 of delete-iod-key (from Perl distribution App-IODUtils), released on 2024-06-24.
=head1 SYNOPSIS
Basic usage:
% delete-iod-key /path/to/file.iod section key
=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<--key>=I<s>*
(No description)
Can also be specified as the 3rd command-line argument.
=item B<--section>=I<s>*
(No description)
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]
( run in 0.649 second using v1.01-cache-2.11-cpan-39bf76dae61 )