summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-03-21 14:03:21 -0600
committermo khan <mo.khan@gmail.com>2020-03-21 14:03:21 -0600
commit9966dbf1e2a949782ec84fa8d4b545482efd8d1d (patch)
tree16f298f82784829c15274f7cee9ea5f333635ae5
parentc8351159af1583536e49f743585ace63cd1e2c5d (diff)
Change default report format to table
-rw-r--r--CHANGELOG.md1
-rw-r--r--README.md2
-rw-r--r--lib/spandx/cli.rb2
-rw-r--r--spec/integration/cli/scan_spec.rb8
-rw-r--r--spec/unit/cli/scan_spec.rb2
5 files changed, 7 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83c9c54..f239cac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Change the default `--format` to `table` for the scan command.
-- Rename `index update` subcommand to `index fetch`.
## [0.11.0] - 2020-03-20
### Added
diff --git a/README.md b/README.md
index d782dd4..b557c15 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ Airgap mode assumes that an offline cache has been placed in `$HOME/.local/share
To fetch the latest offline cache:
```bash
-モ spandx index fetch
+モ spandx index update
```
### Ruby API
diff --git a/lib/spandx/cli.rb b/lib/spandx/cli.rb
index 1360048..ef33d95 100644
--- a/lib/spandx/cli.rb
+++ b/lib/spandx/cli.rb
@@ -23,7 +23,7 @@ module Spandx
method_option :recursive, aliases: '-r', type: :boolean, desc: 'Perform recursive scan', default: false
method_option :airgap, aliases: '-a', type: :boolean, desc: 'Disable network connections', default: false
method_option :logfile, aliases: '-l', type: :string, desc: 'Path to a logfile', default: '/dev/null'
- method_option :format, aliases: '-f', type: :string, desc: 'Format of report', default: 'json'
+ method_option :format, aliases: '-f', type: :string, desc: 'Format of report', default: 'table'
def scan(lockfile)
Spandx.airgap = options[:airgap]
Spandx.logger = Logger.new(options[:logfile])
diff --git a/spec/integration/cli/scan_spec.rb b/spec/integration/cli/scan_spec.rb
index b9b548e..e00971b 100644
--- a/spec/integration/cli/scan_spec.rb
+++ b/spec/integration/cli/scan_spec.rb
@@ -14,7 +14,7 @@ RSpec.describe '`spandx scan` command', type: :cli do
-l, [--logfile=LOGFILE] # Path to a logfile
# Default: /dev/null
-f, [--format=FORMAT] # Format of report
- # Default: json
+ # Default: table
Scan a lockfile and list dependencies/licenses
OUT
@@ -24,7 +24,7 @@ RSpec.describe '`spandx scan` command', type: :cli do
it 'executes `spandx scan Gemfile.lock`' do
gemfile_lock = fixture_file('bundler/Gemfile.lock')
- output = `spandx scan #{gemfile_lock}`
+ output = `spandx scan #{gemfile_lock} --format=json`
expected_output = <<~OUT
{
"version": "1.0",
@@ -44,7 +44,7 @@ RSpec.describe '`spandx scan` command', type: :cli do
it 'executes `spandx scan gems.lock' do
gemfile_lock = fixture_file('bundler/gems.lock')
- output = `spandx scan #{gemfile_lock}`
+ output = `spandx scan #{gemfile_lock} --format=json`
expected_output = <<~OUT
{
"version": "1.0",
@@ -64,7 +64,7 @@ RSpec.describe '`spandx scan` command', type: :cli do
it 'executes `spandx scan Pipfile.lock`' do
lockfile = fixture_file('pip/Pipfile.lock')
- output = `spandx scan #{lockfile}`
+ output = `spandx scan #{lockfile} --format=json`
expected_output = <<~OUT
{
"version": "1.0",
diff --git a/spec/unit/cli/scan_spec.rb b/spec/unit/cli/scan_spec.rb
index 81d989c..b0a5fe1 100644
--- a/spec/unit/cli/scan_spec.rb
+++ b/spec/unit/cli/scan_spec.rb
@@ -5,7 +5,7 @@ RSpec.describe Spandx::Cli::Commands::Scan do
let(:output) { StringIO.new }
let(:lockfile) { '.' }
- let(:options) { {} }
+ let(:options) { { format: 'json' } }
before do
stub_request(:get, Spandx::Spdx::Gateway::URL)