Print target list with tables

Use Thor print_table method to print into columns for a cleaner look
This commit is contained in:
ViViDboarder 2013-11-22 16:38:04 -08:00
parent cb31d0a80e
commit 09068f2607
2 changed files with 14 additions and 5 deletions

View File

@ -35,8 +35,6 @@ module AbuseTheForce
# Get path to temp project directory
temp_path = File.join(Atf_Config.root_dir, TEMP_DIR)
puts "Config path #{temp_path}"
# Clear temp dir
if Dir.exists? temp_path
FileUtils.rm_r temp_path
@ -240,12 +238,22 @@ module AbuseTheForce
desc "list", "Lists all targets"
def list()
puts "Name\t\tUsername"
target_output = []
target_output.push ["Active", "Alias", "Username", ""]
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
print_table target_output
end
# By default, display the current target

View File

@ -1,3 +1,4 @@
module AbuseTheForce
VERSION = '0.1.3'
VERSION = '0.1.4'
end