]> granicus.if.org Git - handbrake/commitdiff
manicure: Allow manicure to be included in other scripts.
authorbradleys <bradley@bradleysepos.com>
Wed, 25 Jun 2014 22:29:45 +0000 (22:29 +0000)
committerbradleys <bradley@bradleysepos.com>
Wed, 25 Jun 2014 22:29:45 +0000 (22:29 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6222 b64f7644-9d1e-0410-96f1-a4d463321fa5

scripts/manicure.rb

index a6fbaf5713944df384aa4777967382857d01fb5d..d4afb3ed2324b9c14079588c14e996a7ea6a8822 100755 (executable)
@@ -1922,17 +1922,22 @@ class Display
   
 end
 
-# First grab the specified CLI options
-options = readOptions
-
-# Only run if one of the useful CLI flags have been passed
-if options.cliraw == true || options.cliparse == true || options.api == true || options.apilist == true
-  # This line is the ignition -- generates hashes of
-  # presets and then displays them to the screen
-  # with the options the user selects on the CLI. 
-  Display.new( Presets.new.hashMasterList, options )
-else
-  # Direct the user to the help
-  puts "\n\tUsage: manicure.rb [options]"
-  puts "\tSee help with -h or --help"
+# CLI invocation only
+if __FILE__ == $0
+
+  # First grab the specified CLI options
+  options = readOptions
+
+  # Only run if one of the useful CLI flags have been passed
+  if options.cliraw == true || options.cliparse == true || options.api == true || options.apilist == true
+    # This line is the ignition -- generates hashes of
+    # presets and then displays them to the screen
+    # with the options the user selects on the CLI. 
+    Display.new( Presets.new.hashMasterList, options )
+  else
+    # Direct the user to the help
+    puts "\n\tUsage: manicure.rb [options]"
+    puts "\tSee help with -h or --help"
+  end
+
 end