From 507031f77101079406118da7c00f1e441bcc3bb3 Mon Sep 17 00:00:00 2001 From: bradleys Date: Wed, 25 Jun 2014 22:29:45 +0000 Subject: manicure: Allow manicure to be included in other scripts. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6222 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- scripts/manicure.rb | 31 ++++++++++++++++++------------- 1 file 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 -- cgit v1.2.3