Skip to content

Commit 395ba13

Browse files
committed
Update hostname option documentation
1 parent ffe219b commit 395ba13

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

doc/optionsref.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
```
1111
Usage: octocatalog-diff [command line options]
12-
-n, --hostname HOSTNAME Use PuppetDB facts from last run of hostname
12+
-n HOSTNAME1[,HOSTNAME2[,...]], Use PuppetDB facts from last run of a hostname or a comma separated list of multiple hostnames
13+
--hostname
1314
--basedir DIRNAME Use an alternate base directory (git checkout of puppet repository)
1415
-f, --from FROM_BRANCH Branch you are coming from
1516
-t, --to TO_BRANCH Branch you are going to
@@ -856,14 +857,17 @@ Puppet control repo template, the value of this should be 'hieradata', which is
856857

857858
<tr>
858859
<td valign=top>
859-
<pre><code>-n HOSTNAME
860-
--hostname HOSTNAME</code></pre>
860+
<pre><code>-n HOSTNAME1[,HOSTNAME2[,...]]
861+
--hostname HOSTNAME1[,HOSTNAME2[,...]]</code></pre>
861862
</td>
862863
<td valign=top>
863-
Use PuppetDB facts from last run of hostname
864+
Use PuppetDB facts from last run of a hostname or a comma separated list of multiple hostnames
864865
</td>
865866
<td valign=top>
866-
Set hostname, which is used to look up facts in PuppetDB, and in the header of diff display. (<a href="../lib/octocatalog-diff/cli/options/hostname.rb">hostname.rb</a>)
867+
Set hostname, which is used to look up facts in PuppetDB, and in the header of diff display.
868+
This option can recieve a single hostname, or a comma separated list of
869+
multiple hostnames, which are split into an Array. Multiple hostnames do not
870+
work with the `catalog-only` or `bootstrap-then-exit` options. (<a href="../lib/octocatalog-diff/cli/options/hostname.rb">hostname.rb</a>)
867871
</td>
868872
</tr>
869873

lib/octocatalog-diff/cli/options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Cli
1111
# This class contains the option parser. 'parse_options' is the external entry point.
1212
class Options
1313
# The usage banner.
14-
BANNER = 'Usage: catalog-diff -n <hostname> [-f <from environment>] [-t <to environment>]'.freeze
14+
BANNER = 'Usage: catalog-diff -n <hostname>[,<hostname>...] [-f <from environment>] [-t <to environment>]'.freeze
1515

1616
# An error class specifically for passing information to the document build task.
1717
class DocBuildError < RuntimeError; end

lib/octocatalog-diff/cli/options/hostname.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
# frozen_string_literal: true
22

33
# Set hostname, which is used to look up facts in PuppetDB, and in the header of diff display.
4+
# This option can recieve a single hostname, or a comma separated list of
5+
# multiple hostnames, which are split into an Array. Multiple hostnames do not
6+
# work with the `catalog-only` or `bootstrap-then-exit` options.
47
# @param parser [OptionParser object] The OptionParser argument
58
# @param options [Hash] Options hash being constructed; this is modified in this method.
69

710
OctocatalogDiff::Cli::Options::Option.newoption(:hostname) do
811
has_weight 1
912

1013
def parse(parser, options)
11-
parser.on('--hostname HOSTNAME', '-n', 'Use PuppetDB facts from last run of hostname') do |hostname|
14+
parser.on(
15+
'--hostname HOSTNAME1[,HOSTNAME2[,...]]',
16+
'-n',
17+
'Use PuppetDB facts from last run of a hostname or a comma separated list of multiple hostnames'
18+
) do |hostname|
1219
options[:node] = if hostname.include?(',')
1320
hostname.split(',')
1421
else

0 commit comments

Comments
 (0)