summaryrefslogtreecommitdiffstats
path: root/scripts/manicure.rb
diff options
context:
space:
mode:
authorbradleys <[email protected]>2014-06-25 22:29:45 +0000
committerbradleys <[email protected]>2014-06-25 22:29:45 +0000
commit507031f77101079406118da7c00f1e441bcc3bb3 (patch)
tree17885467f944de6e9e89d51ed5bd95df934cd944 /scripts/manicure.rb
parentc4ac02f9369c94aaa5a8740f66cc088c065cf4c1 (diff)
manicure: Allow manicure to be included in other scripts.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6222 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'scripts/manicure.rb')
-rwxr-xr-xscripts/manicure.rb31
1 files changed, 18 insertions, 13 deletions
diff --git a/scripts/manicure.rb b/scripts/manicure.rb
index a6fbaf571..d4afb3ed2 100755
--- a/scripts/manicure.rb
+++ b/scripts/manicure.rb
@@ -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