Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added -d flag to patchmaster script.

  • Loading branch information...
commit 5ebd820b0d884ba3da90500ba79f4e707a7a333d 1 parent 9a28ddb
@jimm authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 bin/patchmaster
View
12 bin/patchmaster
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#
-# usage: patchmaster [-i] [pm_file]
+# usage: patchmaster [-n] [-d] [pm_file]
#
# Starts PatchMaster and optionally loads pm_file.
#
@@ -9,10 +9,18 @@
# ignored, and no MIDI data is sent/received. That is useful if you want to
# run PatchMaster without actually talking to any MIDI instruments.
+require 'optparse'
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
-if ARGV[0] == '-n'
+if !use_midi
pm.no_midi!
ARGV.shift
end
Please sign in to comment.
Something went wrong with that request. Please try again.