Added version command as well as small cleanup

Cleaned up some of the output
This commit is contained in:
ViViDboarder 2013-04-18 17:56:22 -07:00
parent ec3578e2a2
commit 952e1dc201
3 changed files with 17 additions and 8 deletions

View File

@ -23,6 +23,8 @@ module AbuseTheForce
def self.build_client def self.build_client
target = Atf_Config.active_target target = Atf_Config.active_target
puts target.username
@client = Metaforce.new :username => target.username, @client = Metaforce.new :username => target.username,
:password => target.get_password, :password => target.get_password,
:security_token => target.security_token :security_token => target.security_token
@ -140,6 +142,8 @@ module AbuseTheForce
#write out the config #write out the config
dump_settings dump_settings
puts "Target Added"
target.print
end end
# Selects one target as the active target for deployment # Selects one target as the active target for deployment
@ -158,9 +162,6 @@ module AbuseTheForce
target.active = true target.active = true
# Make it default # Make it default
@active_target = target @active_target = target
else
# Error since there are two defaults
AbuseTheForce.putw "Two defaults set. Using #{@active_target.print}"
end end
else # name != name else # name != name
# make not active # make not active
@ -171,9 +172,13 @@ module AbuseTheForce
if @active_target != nil if @active_target != nil
# Save to yaml # Save to yaml
dump_settings dump_settings
# Notify the user
puts "Active target changed"
@active_target.print
else else
AbuseTheForce.pute "Target with alias #{name} was not found." AbuseTheForce.pute "Target with alias #{name} was not found."
end end
end end
# Sets project path from default ./src # Sets project path from default ./src
@ -186,7 +191,6 @@ module AbuseTheForce
end end
end end
end end
end end

View File

@ -1,5 +1,6 @@
require 'thor' require 'thor'
require 'highline/import' require 'highline/import'
require 'abusetheforce/version'
module AbuseTheForce module AbuseTheForce
@ -54,7 +55,7 @@ module AbuseTheForce
--token=<security token> option, sets the security token to the value provided --token=<security token> option, sets the security token to the value provided
The changes will then be written to the atf.yaml file The changes will then be written to the .abusetheforce.yaml file
LONG_DESC LONG_DESC
option :password, :type => :boolean, :aliases => :p, :default => false, :desc => "Prompt for password" option :password, :type => :boolean, :aliases => :p, :default => false, :desc => "Prompt for password"
option :token, :banner => "<security token>" option :token, :banner => "<security token>"
@ -219,8 +220,6 @@ module AbuseTheForce
# Get the base name of the metadata # Get the base name of the metadata
full_name = File.basename(full_name, extname) full_name = File.basename(full_name, extname)
puts full_name
puts extname
# Detect metadata type by file extension # Detect metadata type by file extension
case extname case extname
when '.cls' when '.cls'
@ -280,6 +279,12 @@ module AbuseTheForce
desc "retrieve SUBCOMMAND ...ARGS", "Retrieve code from Salesforce.com" desc "retrieve SUBCOMMAND ...ARGS", "Retrieve code from Salesforce.com"
subcommand "retrieve", RetrieveCLI subcommand "retrieve", RetrieveCLI
desc "version", "Version information"
def version
puts "version #{AbuseTheForce::VERSION}"
end
end end
# Start the command line # Start the command line

View File

@ -1,3 +1,3 @@
module AbuseTheForce module AbuseTheForce
VERSION = '0.0.1' VERSION = '0.0.2'
end end