Skip to content

Commit 6768f58

Browse files
authored
Merge pull request #47 from github/kpaulisse-split-cli
(WIP) Move octocatalog-diff/catalog-diff/cli -> lib/octocatalog-diff/cli
2 parents 6df2819 + 6dd8ea2 commit 6768f58

168 files changed

Lines changed: 1326 additions & 1345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/octocatalog-diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ elsif config_test
7171
end
7272

7373
argv = ARGV.dup
74-
exit_code = OctocatalogDiff::CatalogDiff::Cli.cli(argv, Logger.new(STDERR), options)
74+
exit_code = OctocatalogDiff::Cli.cli(argv, Logger.new(STDERR), options)
7575
exit(exit_code)

doc/advanced-pe-enc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Please see [Authentication token](https://docs.puppet.com/pe/latest/nc_forming_r
3939

4040
The referenced document contains links to generate a token with the `puppet-access` command.
4141

42-
Note that if you wish to hard-code an authentication token in your [configuration file](/doc/configuration.md), the internal variable key is `:pe_enc_token` and the content is a string containing the entire token. (The `--pe-enc-token-file` option simply reads the provided file and stores the content in the `:pe_enc_token` key. See [source](/lib/octocatalog-diff/catalog-diff/cli/options/pe_enc_token_file.rb).)
42+
Note that if you wish to hard-code an authentication token in your [configuration file](/doc/configuration.md), the internal variable key is `:pe_enc_token` and the content is a string containing the entire token. (The `--pe-enc-token-file` option simply reads the provided file and stores the content in the `:pe_enc_token` key. See [source](/lib/octocatalog-diff/cli/options/pe_enc_token_file.rb).)
4343

4444
### SSL client keypair
4545

doc/dev/how-to-add-options.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ This document contains a checklist and guidance to adding new command line optio
77
Please copy and paste this text into your Pull Request. This will create boxes for each step along the way, which you can then check off when complete.
88

99
```
10-
- [ ] REQUIRED: Add new file in `lib/octocatalog-diff/catalog-diff/cli/options`
11-
- [ ] REQUIRED: Add corresponding test in `spec/octocatalog-diff/tests/catalog-diff/cli/options`
12-
- [ ] OPTIONAL: Add default value in `lib/octocatalog-diff/catalog-diff/cli.rb`
10+
- [ ] REQUIRED: Add new file in `lib/octocatalog-diff/cli/options`
11+
- [ ] REQUIRED: Add corresponding test in `spec/octocatalog-diff/tests/cli/options`
12+
- [ ] OPTIONAL: Add default value in `lib/octocatalog-diff/cli.rb`
1313
- [ ] OPTIONAL: Add configuration example in `examples/octocatalog-diff.cfg.rb`
1414
- [ ] REQUIRED: Add code to implement your option in `lib`
1515
- [ ] REQUIRED: Add corresponding tests for code to implement your option in `spec/octocatalog-diff/tests`
@@ -20,7 +20,7 @@ Please copy and paste this text into your Pull Request. This will create boxes f
2020

2121
### Create option parser
2222

23-
Option parsers are created in [`lib/octocatalog-diff/catalog-diff/cli/options`](/lib/octocatalog-diff/catalog-diff/cli/options).
23+
Option parsers are created in [`lib/octocatalog-diff/cli/options`](/lib/octocatalog-diff/cli/options).
2424

2525
Your option should have a "long form" that contains dashes and not underscores. For example, you should prefer `--your-new-option` and NOT use `--your_new_option`.
2626

@@ -32,31 +32,31 @@ If you are creating a binary (yes-no) option, please recognize both `--your-new-
3232

3333
We recommend copying prior art as a template:
3434

35-
- For a binary (yes-no) option, look at [`quiet.rb`](/lib/octocatalog-diff/catalog-diff/cli/options/quiet.rb).
35+
- For a binary (yes-no) option, look at [`quiet.rb`](/lib/octocatalog-diff/cli/options/quiet.rb).
3636

37-
- For an option that takes an integer parameter, look at [`retry_failed_catalog.rb`](/lib/octocatalog-diff/catalog-diff/cli/options/retry_failed_catalog.rb).
37+
- For an option that takes an integer parameter, look at [`retry_failed_catalog.rb`](/lib/octocatalog-diff/cli/options/retry_failed_catalog.rb).
3838

39-
- For an option that takes an string parameter, look at [`bootstrap_script.rb`](/lib/octocatalog-diff/catalog-diff/cli/options/bootstrap_script.rb).
39+
- For an option that takes an string parameter, look at [`bootstrap_script.rb`](/lib/octocatalog-diff/cli/options/bootstrap_script.rb).
4040

41-
- For an option that takes an array or can be specified more than once, look at [`bootstrap_environment.rb`](/lib/octocatalog-diff/catalog-diff/cli/options/bootstrap_environment.rb).
41+
- For an option that takes an array or can be specified more than once, look at [`bootstrap_environment.rb`](/lib/octocatalog-diff/cli/options/bootstrap_environment.rb).
4242

43-
If you can do simple validation of the argument, such as making sure the argument (if specified) matches a particular regular expression or is one of a particular set of values, please do that within the option file. For example, look at [`facts_terminus.rb`](/lib/octocatalog-diff/catalog-diff/cli/options/facts_terminus.rb).
43+
If you can do simple validation of the argument, such as making sure the argument (if specified) matches a particular regular expression or is one of a particular set of values, please do that within the option file. For example, look at [`facts_terminus.rb`](/lib/octocatalog-diff/cli/options/facts_terminus.rb).
4444

4545
### Create test for option parser
4646

47-
Option parser tests are created in [`spec/octocatalog-diff/tests/catalog-diff/cli/options`](/spec/octocatalog-diff/tests/catalog-diff/cli/options).
47+
Option parser tests are created in [`spec/octocatalog-diff/tests/cli/options`](/spec/octocatalog-diff/tests/cli/options).
4848

4949
If you used an existing option as a reference for your new code, consider using that option's test as a reference for your test. We have some methods, e.g. `test_with_true_false_option`, to avoid repetitive code for common patterns.
5050

51-
If you have handled any edge cases, e.g. input validation, please add a test that expects an error when input is provided that does not match your validation. For example, look at [`parser_spec.rb`](/spec/octocatalog-diff/tests/catalog-diff/cli/options/parser_spec.rb).
51+
If you have handled any edge cases, e.g. input validation, please add a test that expects an error when input is provided that does not match your validation. For example, look at [`parser_spec.rb`](/spec/octocatalog-diff/tests/cli/options/parser_spec.rb).
5252

5353
### Add default value (OPTIONAL)
5454

5555
Unless specifically cleared with the project maintainers, adding a new option should not change the behavior of the program when that option isn't specified, and the new option should not be required.
5656

5757
In other words, if someone invokes the program *without* specifying your option, it should behave in the same way as it did before your option was ever added.
5858

59-
If you need to set a default value for your option, do so in [`lib/octocatalog-diff/catalog-diff/cli.rb`](/lib/octocatalog-diff/catalog-diff/cli.rb). Items should be added to DEFAULT_OPTIONS *only if* a value is required even if your option is not provided, or if you are defaulting something to *true* but providing an option to make it false.
59+
If you need to set a default value for your option, do so in [`lib/octocatalog-diff/cli.rb`](/lib/octocatalog-diff/cli.rb). Items should be added to DEFAULT_OPTIONS *only if* a value is required even if your option is not provided, or if you are defaulting something to *true* but providing an option to make it false.
6060

6161
### Add configuration example (OPTIONAL)
6262

0 commit comments

Comments
 (0)