[Swift-commit] r3328 - in SwiftApps/adem-osg/lib: . adem

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon May 3 14:57:25 CDT 2010


Author: aespinosa
Date: 2010-05-03 14:57:25 -0500 (Mon, 03 May 2010)
New Revision: 3328

Added:
   SwiftApps/adem-osg/lib/adem/help.rb
Modified:
   SwiftApps/adem-osg/lib/adem.rb
   SwiftApps/adem-osg/lib/adem/app.rb
Log:
Added general help command

Modified: SwiftApps/adem-osg/lib/adem/app.rb
===================================================================
--- SwiftApps/adem-osg/lib/adem/app.rb	2010-05-03 19:57:22 UTC (rev 3327)
+++ SwiftApps/adem-osg/lib/adem/app.rb	2010-05-03 19:57:25 UTC (rev 3328)
@@ -1,8 +1,6 @@
-require 'optparse'
-
 def app(args, conf)
   options = {}
-  site_conf = nil
+  site_conf = conf[:sites]
   optparse = OptionParser.new do |opts|
     opts.banner = "Usage: adem app [options]"
 
@@ -27,6 +25,7 @@
     end
   end
   optparse.parse!
+  site_conf
 end
 
 def app_avail(pacman_cache)

Added: SwiftApps/adem-osg/lib/adem/help.rb
===================================================================
--- SwiftApps/adem-osg/lib/adem/help.rb	                        (rev 0)
+++ SwiftApps/adem-osg/lib/adem/help.rb	2010-05-03 19:57:25 UTC (rev 3328)
@@ -0,0 +1,22 @@
+def help
+  text = <<-eos
+
+ADEM is a tool for deploying and managing software on the Open Science Grid.
+
+  Usage:
+    adem command [options]
+
+  Examples:
+    adem config --display
+    adem sites --update
+    adem app --avail
+
+  Further help:
+    adem config -h/--help        Configure ADEM
+    adem sites -h/--help         Manipulate the site list
+    adem app -h/--help           Application installation
+    adem help                    This help message
+  eos
+  puts text
+  text
+end

Modified: SwiftApps/adem-osg/lib/adem.rb
===================================================================
--- SwiftApps/adem-osg/lib/adem.rb	2010-05-03 19:57:22 UTC (rev 3327)
+++ SwiftApps/adem-osg/lib/adem.rb	2010-05-03 19:57:25 UTC (rev 3328)
@@ -5,6 +5,7 @@
 require 'adem/config'
 require 'adem/sites'
 require 'adem/app'
+require 'adem/help'
 
 CONFIGURATION_FILE = "#{ENV['HOME']}/.adem/config"
 SITES_FILE         = "#{ENV['HOME']}/.adem/sites"
@@ -13,6 +14,7 @@
 def run_command(args, config_file, sites_file)
   command = args.shift
   output = nil
+  return help if command == "help"
   conf = config args, config_file
   return conf if command == "config"
   begin




More information about the Swift-commit mailing list