Skip to content

Commit 722b9cf

Browse files
author
Kevin Paulisse
committed
Add fixture repo for arbitrary command line options, and option
1 parent 330035b commit 722b9cf

8 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
# Provide additional command line flags to set when running Puppet to compile catalogs.
4+
# @param parser [OptionParser object] The OptionParser argument
5+
# @param options [Hash] Options hash being constructed; this is modified in this method.
6+
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:command_line) do
7+
has_weight 510
8+
9+
def parse(parser, options)
10+
OctocatalogDiff::CatalogDiff::Cli::Options.option_globally_or_per_branch(
11+
parser: parser,
12+
options: options,
13+
cli_name: 'command-line',
14+
option_name: 'command_line',
15+
desc: 'Command line arguments',
16+
datatype: []
17+
)
18+
end
19+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
modulepath = ./modules
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node default {
2+
file { '/tmp/environment-foo-site':
3+
content => 'File created from environments/foo/manifests/site.pp',
4+
}
5+
include foo
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class foo {
2+
file { '/tmp/environment-foo-module':
3+
content => 'Created by environments/foo modules/foo',
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node default {
2+
file { '/tmp/environment-production-site':
3+
content => 'File created from environments/production/manifests/site.pp',
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node default {
2+
file { '/tmp/foo':
3+
content => 'File created from manifests/site.pp',
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class foo {
2+
file { '/tmp/foo-module':
3+
content => 'Created by main modules/foo',
4+
}
5+
}
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::CatalogDiff::Cli::Options do
6+
describe '#opt_command_line' do
7+
include_examples 'global array option', 'command-line', :command_line
8+
end
9+
end

0 commit comments

Comments
 (0)