Skip to content

Commit 1cdeffa

Browse files
author
Kevin Paulisse
committed
Add --truncate-details option
1 parent 9a95923 commit 1cdeffa

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

doc/optionsref.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Usage: octocatalog-diff [command line options]
5959
--from-enc PATH Path to ENC script (for the from catalog only)
6060
--to-enc PATH Path to ENC script (for the to catalog only)
6161
--[no-]display-detail-add Display parameters and other details for added resources
62+
--[no-]truncate-details Truncate details with --display-detail-add
6263
--no-header Do not print a header
6364
--default-header Print default header with output
6465
--header STRING Specify header for output
@@ -1092,6 +1093,21 @@ These files must exist and be in Puppet catalog format. (<a href="../lib/octocat
10921093
</td>
10931094
</tr>
10941095

1096+
<tr>
1097+
<td valign=top>
1098+
<pre><code>--truncate-details
1099+
--no-truncate-details </code></pre>
1100+
</td>
1101+
<td valign=top>
1102+
Truncate details with --display-detail-add
1103+
</td>
1104+
<td valign=top>
1105+
When using `--display-detail-add` by default the details of any field will be truncated
1106+
at 80 characters. Specify `--no-truncate-details` to display the full output. This option
1107+
has no effect when `--display-detail-add` is not used. (<a href="../lib/octocatalog-diff/cli/options/truncate_details.rb">truncate_details.rb</a>)
1108+
</td>
1109+
</tr>
1110+
10951111
<tr>
10961112
<td valign=top>
10971113
<pre><code>--validate-references
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# When using `--display-detail-add` by default the details of any field will be truncated
4+
# at 80 characters. Specify `--no-truncate-details` to display the full output. This option
5+
# has no effect when `--display-detail-add` is not used.
6+
# @param parser [OptionParser object] The OptionParser argument
7+
# @param options [Hash] Options hash being constructed; this is modified in this method.
8+
OctocatalogDiff::Cli::Options::Option.newoption(:truncate_details) do
9+
has_weight 251
10+
11+
def parse(parser, options)
12+
parser.on('--[no-]truncate-details', 'Truncate details with --display-detail-add') do |x|
13+
options[:truncate_details] = x
14+
end
15+
end
16+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../options_helper'
4+
5+
describe OctocatalogDiff::Cli::Options do
6+
describe '#opt_truncate_details' do
7+
include_examples 'true/false option', 'truncate-details', :truncate_details
8+
end
9+
end

0 commit comments

Comments
 (0)