starscope 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,3 +1,9 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ starscope (0.0.1)
5
+ parser
6
+
1
7
  GEM
2
8
  remote: https://rubygems.org/
3
9
  specs:
@@ -29,7 +35,7 @@ PLATFORMS
29
35
 
30
36
  DEPENDENCIES
31
37
  bundler (~> 1.3)
32
- parser
33
38
  pry
34
39
  pry-debugger
35
40
  rake
41
+ starscope!
data/bin/starscope.rb CHANGED
@@ -11,30 +11,41 @@ DEFAULT_DB=".starscope.db"
11
11
 
12
12
  # Options Parsing
13
13
  OptionParser.new do |opts|
14
- opts.banner = "Usage: starscope.rb [options] [PATHS]"
14
+ opts.banner = <<END
15
+ Usage: starscope.rb [options] [PATHS]
15
16
 
16
- opts.on("-d", "--dump [TABLE]", "Dumps the DB or specified table to standard-out") do |tbl|
17
- options[:dump] = tbl || true
18
- end
17
+ If you don't pass any of -n, -r, -w or PATHS the default behaviour is to recurse
18
+ in the current directory and build or update the database `#{DEFAULT_DB}`.
19
19
 
20
- opts.on("-n", "--no-auto", "Don't automatically create or update the database") do
21
- options[:auto] = false
22
- end
20
+ Query scopes must be specified with `::`, for example -q calls,File::mtime.
21
+ END
23
22
 
24
- opts.on("-q", "--query QUERY", "Queries the database") do |query|
23
+ opts.separator "\nQueries"
24
+ opts.on("-d", "--dump [TABLE]", "Dumps the DB or specified table to stdout") do |tbl|
25
+ options[:dump] = tbl || true
26
+ end
27
+ opts.on("-q", "--query TABLE,QUERY", "Looks up QUERY in TABLE") do |query|
25
28
  options[:query] = query
26
29
  end
30
+ opts.on("-s", "--summary", "Print a database summary to stdout") do
31
+ options[:summary] = true
32
+ end
27
33
 
28
- opts.on("-r", "--read-db READ", "Reads the database from PATH instead of #{DEFAULT_DB}") do |path|
34
+ opts.separator "\nDatabase Management"
35
+ opts.on("-n", "--no-auto", "Don't automatically update/create the database") do
36
+ options[:auto] = false
37
+ end
38
+ opts.on("-r", "--read-db READ", "Reads the DB from PATH instead of the default") do |path|
29
39
  options[:read] = path
30
40
  end
31
-
32
- opts.on("-s", "--summary", "Print a database summary to standard-out") do
33
- options[:summary] = true
41
+ opts.on("-w", "--write-db PATH", "Writes the DB to PATH instead of the default") do |path|
42
+ options[:write] = path
34
43
  end
35
44
 
36
- opts.on("-w", "--write-db PATH", "Writes the database to PATH instead of #{DEFAULT_DB}") do |path|
37
- options[:write] = path
45
+ opts.separator "\nMisc"
46
+ opts.on("-v", "--version", "Print the version number") do
47
+ puts StarScope::VERSION
48
+ exit
38
49
  end
39
50
 
40
51
  end.parse!
@@ -1,3 +1,3 @@
1
1
  module StarScope
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: starscope
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Evan Huus