From 2907cc6dd0b0d2d80d44ae292a157651d6e05ee7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Aug 2013 05:25:22 +0000 Subject: player: flesh out multi-source in protocol/sourceedit We should be fully-capable of managing any number of options to try sources in. --- bin/dtas-sourceedit | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bin/dtas-sourceedit') diff --git a/bin/dtas-sourceedit b/bin/dtas-sourceedit index c55000a..7e30e6b 100755 --- a/bin/dtas-sourceedit +++ b/bin/dtas-sourceedit @@ -8,15 +8,15 @@ require 'dtas/unix_client' require 'dtas/disclaimer' editor = ENV["VISUAL"] || ENV["EDITOR"] || "vi" c = DTAS::UNIXClient.new -usage = $0 -ARGV.size == 0 or abort usage -name = ARGV[0] +usage = "#$0 " +ARGV.size <= 1 or abort usage +name = ARGV[0] || "sox" tmp = Tempfile.new(%w(dtas-sourceedit .yml)) tmp.sync = true tmp.binmode -buf = c.req(%W(source cat)) +buf = c.req(%W(source cat #{name})) abort(buf) if buf =~ /\AERR/ orig = YAML.load(buf) @@ -26,7 +26,7 @@ system(cmd) or abort "#{cmd} failed: #$?" tmp.rewind source = YAML.load(tmp.read) -cmd = %W(source ed) +cmd = %W(source ed #{name}) if env = source["env"] env.each do |k,v| cmd << (v.nil? ? "env##{k}" : "env.#{k}=#{v}") -- cgit v1.2.3-24-ge0c7