App-IODUtils
view release on metacpan or search on metacpan
script/insert-iod-section view on Meta::CPAN
$args{section},
);
App::IODUtils::_return_mod_result(\%args, $doc);
}
Perinci::CmdLine::Any->new(
url => '/main/insert_iod_section',
read_config => 0,
read_env => 0,
)->run;
# ABSTRACT: Insert an new empty section to IOD configuration file
# PODNAME: insert-iod-section
__END__
=pod
=encoding UTF-8
=head1 NAME
insert-iod-section - Insert an new empty section to IOD configuration file
=head1 VERSION
This document describes version 0.164 of insert-iod-section (from Perl distribution App-IODUtils), released on 2024-06-24.
=head1 SYNOPSIS
Basic usage:
% insert-iod-section /path/to/file.iod section
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--add>
When section already exists, add another.
=item B<--comment>=I<s>
Add comment.
=item B<--ignore>
When section already exists, do nothing.
=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<--linum>=I<s>
Put section line at a specific line number (line number starts from 1).
=item B<--section>=I<s>*
(No description)
Can also be specified as the 2nd command-line argument.
=item B<--top>
Add to the beginning of file instead of end.
=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 1.001 second using v1.01-cache-2.11-cpan-39bf76dae61 )