4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/outrider/commandify.rb', line 4
def self.process
sub_commands = %w(create_project create_project_db_row delete_project crawl intel test_super)
sub_commands << %w()
global_opts = Trollop::options do
banner "CLI for Outrider data processing tools"
opt :dry_run, "Don't actually do anything", :short => "-n"
stop_on sub_commands
end
command = ARGV.shift
command_opts = Trollop::options do
opt :domain, "The domain", :short => "-d", :type => String, :default => ''
opt :limit, "Limit", :short => "-l", :type => Integer,:default => 1000
opt :project, "The name of the project", :short => "-p", :type => String, :default => ''
opt :filename, "Write data to a filename", :short => "-f", :type => String, :default => ''
opt :restrict, "Can only be crawled within the domain", :short => "-r", :default => true
opt :set_project, "If we need to set project", :short => "-s", :default => true
opt :intel_command, "What's the secondary command", :short => "-i", :type => String, :default => ''
end
puts "Invalid Command" unless sub_commands.include? command
return {
:action => command,
:options => command_opts
}
end
|