cvss_cli 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 586a1192e87c8d2d0048cf5dceecdb4eab527f2fd6ee20ab598d0bd36ba1c910
4
- data.tar.gz: d644c2c712c14b49ada11f8a39dbe5483c3bb1d1645804b08aabe4d991e192d8
3
+ metadata.gz: efab40941a8e1f9dbf9025e11e7fb194d8653038d21240f7a4433a2d607558b5
4
+ data.tar.gz: 3a7a665b48ffdcb366824946e92d021bb47b2a4fd34c753dded3abef24926821
5
5
  SHA512:
6
- metadata.gz: 4753ac27b59aa74b91ddace53c3d4e90d6ec2cf2ca5b6c331b9d886daca9105606074481e9cbb6e3efac0c29a95b8f3a00031360a0b538832f7738f367be036a
7
- data.tar.gz: db1e33b6dff5225ceb222381ac9282ec57df88566975e11dd7f6e0854e06e0ac755dfc2f31ec8ac3f564c202cd2ada6ffd8045fca50d4561f126c33b47d9f47b
6
+ metadata.gz: 7fa56d7cfb8a18a78f7dc5bb3ca7f835e7645f91fa9fd4e3556a05558aa3cfdc0499f3816fa0ef99b0db454bdad7abd4f770fb6762e666f2b5aad63fc774f427
7
+ data.tar.gz: ed90e49adad28b389791e2a9800c25aea348c7e4f2b5382a07a390041a84c74614532530df743044b6d1c5a119afa73336f2f0d8f9a05ef2f081a52f5de2e5a4
data/exe/cvss CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "cvss_cli"
3
3
  require 'colorize'
4
+ require 'shellwords'
5
+ require 'readline'
4
6
 
5
7
  if ENV['CVSS_CLI_PATH'].nil?
6
8
  puts 'CVSS_CLI_PATH not set. Please set this environment variable in order to use cvss_cli.'.red
@@ -12,4 +14,18 @@ unless File.exist?(File.join(ENV['CVSS_CLI_PATH'], "cvss3_1.yaml"))
12
14
  exit 1
13
15
  end
14
16
 
15
- CvssCli::CLI.start
17
+ if ARGV.empty?
18
+
19
+ begin
20
+ while line = Readline.readline('cvss> '.light_blue, true)
21
+ args = Shellwords.split line
22
+ CvssCli::CLI.start args if line && !line.empty?
23
+ end
24
+ rescue Exception => e
25
+ puts e
26
+ Kernel.exit 0
27
+ end
28
+
29
+ else
30
+ CvssCli::CLI.start(ARGV)
31
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CvssCli
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/cvss_cli.rb CHANGED
@@ -72,6 +72,12 @@ module CvssCli
72
72
  invoke :load, [cvss_string] if cvss_string
73
73
  end
74
74
 
75
+ desc 'exit', 'exits the application'
76
+ map quit: :exit
77
+ def exit
78
+ Kernel.exit 0
79
+ end
80
+
75
81
  no_commands do
76
82
  def write_file
77
83
  open(File.join(ENV['CVSS_CLI_PATH'], 'cvss_string'), 'w') do |f|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cvss_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Haunschmid, Daniel Haider
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-04 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec