mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-24 04:56:36 +00:00
Print target list with tables
Use Thor print_table method to print into columns for a cleaner look
This commit is contained in:
parent
cb31d0a80e
commit
09068f2607
@ -35,8 +35,6 @@ module AbuseTheForce
|
|||||||
# Get path to temp project directory
|
# Get path to temp project directory
|
||||||
temp_path = File.join(Atf_Config.root_dir, TEMP_DIR)
|
temp_path = File.join(Atf_Config.root_dir, TEMP_DIR)
|
||||||
|
|
||||||
puts "Config path #{temp_path}"
|
|
||||||
|
|
||||||
# Clear temp dir
|
# Clear temp dir
|
||||||
if Dir.exists? temp_path
|
if Dir.exists? temp_path
|
||||||
FileUtils.rm_r temp_path
|
FileUtils.rm_r temp_path
|
||||||
@ -240,12 +238,22 @@ module AbuseTheForce
|
|||||||
|
|
||||||
desc "list", "Lists all targets"
|
desc "list", "Lists all targets"
|
||||||
def list()
|
def list()
|
||||||
puts "Name\t\tUsername"
|
target_output = []
|
||||||
|
|
||||||
|
target_output.push ["Active", "Alias", "Username", ""]
|
||||||
|
|
||||||
Atf_Config.targets.values.each do |target|
|
Atf_Config.targets.values.each do |target|
|
||||||
target.print
|
#target.print
|
||||||
|
|
||||||
|
target_output.push ["#{(target.active ? ' ==> ' : ' ')}",
|
||||||
|
target.name,
|
||||||
|
target.username,
|
||||||
|
"#{(target.host.starts_with?('test') ? 'sandbox' : '')}"
|
||||||
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
print_table target_output
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# By default, display the current target
|
# By default, display the current target
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
module AbuseTheForce
|
module AbuseTheForce
|
||||||
VERSION = '0.1.3'
|
VERSION = '0.1.4'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user