Skip to content

Commit

Permalink
(maint) Remove unused vcs option from 'pdk new module'
Browse files Browse the repository at this point in the history
  • Loading branch information
rodjek authored and scotje committed Jul 25, 2017
1 parent 08140ce commit fff0fe4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Generates a new module.
Usage:

```
pdk new module [--template-url=git_url] [--license=spdx_identifier] [--vcs=vcs_provider] module_name [target_dir]
pdk new module [--template-url=git_url] [--license=spdx_identifier] module_name [target_dir]
```

The `pdk new module` command accepts the following arguments and options. Arguments are optional unless otherwise specified.
Expand All @@ -111,10 +111,6 @@ Overrides the template to use for this module. If possible, please contribute yo

Specifies the license this module is written under. See https://spdx.org/licenses/ for a list of open source licenses, or use `proprietary`. Defaults to `Apache-2.0`.

#### `--vcs=vcs_provider`

Specifies the version control driver. Valid values: `git`, `none`. Default: `git`.

#### `--skip-interview`

Suppress interactive queries for initial values. All questions will use the default values.
Expand Down
3 changes: 0 additions & 3 deletions lib/pdk/cli/new/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module PDK::CLI
option nil, 'license', _('Specifies the license this module is written under. ' \
"This should be a identifier from https://spdx.org/licenses/. Common values are 'Apache-2.0', 'MIT', or 'proprietary'."), argument: :required

option nil, 'vcs', _("Specifies the version control driver. Valid values: 'git', 'none'. Default: 'git'."), argument: :required

flag nil, 'skip-interview', _('When specified, skips interactive querying of metadata.')

run do |opts, args, _cmd|
Expand All @@ -35,7 +33,6 @@ module PDK::CLI

opts[:name] = module_name
opts[:target_dir] = target_dir.nil? ? module_name : target_dir
opts[:vcs] ||= 'git'

PDK.logger.info(_('Creating new module: %{modname}') % { modname: module_name })
PDK::Generate::Module.invoke(opts)
Expand Down
18 changes: 0 additions & 18 deletions spec/unit/cli/new/module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@
end
end

context 'and the vcs option' do
let(:vcs) { 'svn' }

it 'passes the value of the vcs option to PDK::Generate::Module.invoke' do
expect(PDK::Generate::Module).to receive(:invoke).with(hash_including(vcs: vcs))
expect(logger).to receive(:info).with("Creating new module: #{module_name}")
PDK::CLI.run(['new', 'module', '--vcs', vcs, module_name])
end
end

context 'without the vcs option' do
it 'defaults the value of the vcs option to git' do
expect(PDK::Generate::Module).to receive(:invoke).with(hash_including(vcs: 'git'))
expect(logger).to receive(:info).with("Creating new module: #{module_name}")
PDK::CLI.run(['new', 'module', module_name])
end
end

context 'and the license option' do
let(:license) { 'MIT' }

Expand Down

0 comments on commit fff0fe4

Please sign in to comment.