Skip to content

Commit

Permalink
Added -d flag to patchmaster script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimm committed Apr 11, 2012
1 parent 9a28ddb commit 5ebd820
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/patchmaster
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# #
# usage: patchmaster [-i] [pm_file] # usage: patchmaster [-n] [-d] [pm_file]
# #
# Starts PatchMaster and optionally loads pm_file. # Starts PatchMaster and optionally loads pm_file.
# #
Expand All @@ -9,10 +9,18 @@
# ignored, and no MIDI data is sent/received. That is useful if you want to # ignored, and no MIDI data is sent/received. That is useful if you want to
# run PatchMaster without actually talking to any MIDI instruments. # run PatchMaster without actually talking to any MIDI instruments.


require 'optparse'
require 'patchmaster' require 'patchmaster'


use_midi = true
OptionParser.new do |opts|
opts.banner = "usage: patchmaster [options] [pm_file]"
opts.on("-d", "--debug", "Turn on debug mode") { $DEBUG = true }
opts.on("-n", "--no-midi", "Turn off MIDI processing") { use_midi = false }
end.parse!(ARGV)

pm = PM::Main.instance pm = PM::Main.instance
if ARGV[0] == '-n' if !use_midi
pm.no_midi! pm.no_midi!
ARGV.shift ARGV.shift
end end
Expand Down

0 comments on commit 5ebd820

Please sign in to comment.