diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-08-26 05:25:22 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-08-26 05:25:22 +0000 |
commit | 2907cc6dd0b0d2d80d44ae292a157651d6e05ee7 (patch) | |
tree | eba4f5253a37039acc8ec16cb0998ac2fe0a64b7 /bin | |
parent | 3d96e3d4a3ad7fbf45b38c81478f04cffb329e25 (diff) | |
download | dtas-2907cc6dd0b0d2d80d44ae292a157651d6e05ee7.tar.gz |
We should be fully-capable of managing any number of options to try sources in.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dtas-sourceedit | 10 |
1 files changed, 5 insertions, 5 deletions
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 <sox|av>" +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}") |