]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/swapcase_seq
minor changes
[biopieces.git] / bp_bin / swapcase_seq
index 06f6089a4d827fa83d274e93fbb22e2a882209f7..62a69796b04e50b53ab529fd951e7db976d21758 100755 (executable)
@@ -1,37 +1,40 @@
 #!/usr/bin/env ruby
 
-require 'Maasha/biopieces'
-require 'getoptlong'
+require 'optparse'
+require 'pp'
 
-options = GetoptLong.new(
-    [ '--help',       '-?', GetoptLong::NO_ARGUMENT ],
-    [ '--stream_in',  '-I', GetoptLong::REQUIRED_ARGUMENT ],
-    [ '--stream_out', '-O', GetoptLong::REQUIRED_ARGUMENT ],
-    [ '--verbose',    '-v', GetoptLong::NO_ARGUMENT ]
-)
+options = {}
 
-if ARGV.length == 0 then
-    biopiece = $0.split( "/" ).last
-    exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki"
-end
+optparse = OptionParser.new do |opts|
+  opts.on( '-?', '--help', 'Display this screen' ) do
+               biopiece = $0.split( "/" ).last
+               exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki --help"
+    exit
+  end
+
+       opts.on( '-v', '--verbose' ) do
+               options[ :verbose ] = true
+       end
+
+       opts.on( '-I', '--stream_in FILE', Time ) do |arg|
+               options[:stream_in] = arg
+       end
 
-options.each do | opt, arg |
-    puts "option: #{ opt }   argument: #{ arg }"
-
-    case opt
-        when '--help'
-            biopiece = $0.split( "/" ).last
-            exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki --help"
-        when '--stream_in'
-            puts "Stream in"
-            stream = File.open( arg )
-        when '--stream_out'
-            puts "Stream out"
-        when '--verbose'
-            puts "blababnlbalbalbalbalab"
-    end
+#      opts.on( '-I', '--stream_in FILE', "Mandatory argument" ) do |arg|
+#              options[:stream_in] = arg
+#      end
+
+       opts.on( '-O', '--stream_in FILE', "Mandatory argument" ) do |arg|
+               options[:stream_out] = arg
+       end
 end
 
-bp_stream = BioPieces.new( "test.stream" )
+optparse.parse!
+
+pp "Options:", options
+pp "ARGV:", ARGV
 
-puts bp_stream.record_get
+if ARGV.length == 0 then
+       biopiece = $0.split( "/" ).last
+       exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki"
+end