[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28939] trunk/blender/source: GNU style long arguments.

Campbell Barton ideasman42 at gmail.com
Sun May 23 22:39:21 CEST 2010


Revision: 28939
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28939
Author:   campbellbarton
Date:     2010-05-23 22:39:21 +0200 (Sun, 23 May 2010)

Log Message:
-----------
GNU style long arguments. see help menu.

- swapped meanting of -y/-Y to enable/disable automatic python execution (matches window border -w/-W).
- removed '-B', no reason to have this.
- renamed -fpe to --debug-fpe and added to --help

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_args.h
    trunk/blender/source/blender/blenlib/intern/BLI_args.c
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/blender/blenlib/BLI_args.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_args.h	2010-05-23 19:40:38 UTC (rev 28938)
+++ trunk/blender/source/blender/blenlib/BLI_args.h	2010-05-23 20:39:21 UTC (rev 28939)
@@ -43,6 +43,8 @@
 
 /* pass starts at 1, -1 means valid all the time */
 void BLI_argsAdd(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data);
+void BLI_argsAddPair(struct bArgs *ba, char *arg_short, char *arg_long, int pass, BA_ArgCallback cb, void *data);
+
 void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data); /* not case specific */
 
 void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *data);

Modified: trunk/blender/source/blender/blenlib/intern/BLI_args.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_args.c	2010-05-23 19:40:38 UTC (rev 28938)
+++ trunk/blender/source/blender/blenlib/intern/BLI_args.c	2010-05-23 20:39:21 UTC (rev 28939)
@@ -166,6 +166,12 @@
 	internalAdd(ba, arg, pass, 0, cb, data);
 }
 
+void BLI_argsAddPair(struct bArgs *ba, char *arg_short, char *arg_long, int pass, BA_ArgCallback cb, void *data)
+{
+	internalAdd(ba, arg_short, pass, 0, cb, data);
+	internalAdd(ba, arg_long, pass, 0, cb, data);
+}
+
 void BLI_argsAddCase(struct bArgs *ba, char *arg, int pass, BA_ArgCallback cb, void *data)
 {
 	internalAdd(ba, arg, pass, 1, cb, data);

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2010-05-23 19:40:38 UTC (rev 28938)
+++ trunk/blender/source/creator/creator.c	2010-05-23 20:39:21 UTC (rev 28939)
@@ -196,46 +196,76 @@
 static int print_help(int argc, char **argv, void *data)
 {
 	printf ("Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION);
-	printf ("Usage: blender [args ...] [file] [args ...]\n");
-	printf ("\nRender options:\n");
-	printf ("  -b <file>\tLoad <file> in background (often used for background rendering)\n");
-	printf ("    -a render frames from start to end (inclusive), only works when used after -b\n");
-	printf ("    -S <name>\tSet scene <name>\n");
-	printf ("    -f <frame>\tRender frame <frame> and save it\n");				
-	printf ("    -s <frame>\tSet start to frame <frame> (use before the -a argument)\n");
-	printf ("    -e <frame>\tSet end to frame <frame> (use before the -a argument)\n");
-	printf ("    -o <path>\tSet the render path and file name.\n");
+	printf ("Usage: blender [args ...] [file] [args ...]\n\n");
+
+	printf ("Render Options:\n");
+	printf ("  -b or --background <file>\n");
+	printf ("    Load <file> in background (often used for background rendering)\n\n");
+	
+	printf ("    -a or --render-anim\n");
+	printf ("      Render frames from start to end (inclusive), only works when used after -b\n\n");
+	
+	printf ("    -S or --scene <name>\n");
+	printf ("      Set the active scene <name> for rendering, only works when used after -b\n\n");
+	
+	printf ("    -f or --render-frame <frame>\n");
+	printf ("      Render frame <frame> and save it.\n\n");
+	
+	printf ("    -s or --frame-start <frame>\n");
+	printf ("      Set start to frame <frame> (use before the -a argument).\n\n");
+	
+	
+	printf ("    -e or --frame-end <frame>\n");
+	printf ("      Set end to frame <frame> (use before the -a argument).\n\n");
+	
+	printf ("    -o or --render-output <path>\n");
+	printf ("      Set the render path and file name.\n");
 	printf ("      Use // at the start of the path to\n");
 	printf ("        render relative to the blend file.\n");
 	printf ("      The # characters are replaced by the frame number, and used to define zero padding.\n");
 	printf ("        ani_##_test.png becomes ani_01_test.png\n");
 	printf ("        test-######.png becomes test-000001.png\n");
-	printf ("        When the filename has no #, The suffix #### is added to the filename\n");
+	printf ("        When the filename does not contain #, The suffix #### is added to the filename\n");
 	printf ("      The frame number will be added at the end of the filename.\n");
-	printf ("      eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n");
-	printf ("    -E <engine>\tSpecify the render engine.\n");
-	printf ("      use -E help to list available engines.\n");
-	printf ("\nFormat options:\n");
-	printf ("    -F <format>\tSet the render format, Valid options are...\n");
-	printf ("    \tTGA IRIS JPEG MOVIE IRIZ RAWTGA\n");
-	printf ("    \tAVIRAW AVIJPEG PNG BMP FRAMESERVER\n");
+	printf ("        eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n");
+	printf ("        test-######.png becomes test-000001.png\n\n");
+
+	printf ("    -E or --engine <engine>\n");
+	printf ("      Specify the render engine.\n");
+	printf ("      use -E help to list available engines.\n\n");
+	
+	printf ("Format Options:\n");
+	printf ("  -F or --render-format <format>\n");
+	printf ("    Set the render format, Valid options are...\n");
+	printf ("      TGA IRIS JPEG MOVIE IRIZ RAWTGA\n");
+	printf ("      AVIRAW AVIJPEG PNG BMP FRAMESERVER\n");
 	printf ("    (formats that can be compiled into blender, not available on all systems)\n");
-	printf ("    \tHDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n");
-	printf ("    -x <bool>\tSet option to add the file extension to the end of the file.\n");
-	printf ("    -t <threads>\tUse amount of <threads> for rendering (background mode only).\n");
-	printf ("      [1-%d], 0 for systems processor count.\n", BLENDER_MAX_THREADS);
-	printf ("\nAnimation playback options:\n");
+	printf ("      HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS\n\n");
+
+	printf ("  -x or --use-extension <bool>\n");
+	printf ("    Set option to add the file extension to the end of the file.\n\n");
+
+	printf ("  -t or --threads <threads>\n");
+	printf ("    Use amount of <threads> for rendering (background mode only).\n");
+	printf ("    [1-%d], 0 for systems processor count.\n\n", BLENDER_MAX_THREADS);
+
+	printf ("Animation Playback Options:\n");
 	printf ("  -a <options> <file(s)>\tPlayback <file(s)>, only operates this way when -b is not used.\n");
 	printf ("    -p <sx> <sy>\tOpen with lower left corner at <sx>, <sy>\n");
 	printf ("    -m\t\tRead from disk (Don't buffer)\n");
 	printf ("    -f <fps> <fps-base>\t\tSpecify FPS to start with\n");
 	printf ("    -j <frame>\tSet frame step to <frame>\n");
 				
-	printf ("\nWindow options:\n");
-	printf ("  -w\t\tForce opening with borders (default)\n");
-	printf ("  -W\t\tForce opening without borders\n");
-	printf ("  -p <sx> <sy> <w> <h>\tOpen with lower left corner at <sx>, <sy>\n");
-	printf ("                      \tand width and height <w>, <h>\n");
+	printf ("Window Options:\n");
+	printf ("  -w or --window-border\n");
+	printf ("    Force opening with borders (default)\n\n");
+	
+	printf ("  -W or --window-borderless\n");
+	printf ("    Force opening with without borders\n\n");
+
+	printf ("  -p or --window-geometry <sx> <sy> <w> <h>\n");
+	printf ("    Open with lower left corner at <sx>, <sy> and width and height as <w>, <h>\n\n");
+
 	printf ("\nGame Engine specific options:\n");
 	printf ("  -g fixedtime\t\tRun on 50 hertz without dropping frames\n");
 	printf ("  -g vertexarrays\tUse Vertex Arrays for rendering (usually faster)\n");
@@ -243,53 +273,71 @@
 	printf ("  -g linearmipmap\tLinear Texture Mipmapping instead of Nearest (default)\n");
 
 	printf ("\nMisc options:\n");
-	printf ("  -d\t\tTurn debugging on\n");
-	printf ("    \t\t * prints every operator call and their arguments\n");
-	printf ("    \t\t * disables mouse grab (to interact with a debugger in some cases)\n");
-	printf ("    \t\t * keeps python sys.stdin rather then setting it to None\n");
-	printf ("  -nojoystick\tDisable joystick support\n");
-	printf ("  -noglsl\tDisable GLSL shading\n");
-	printf ("  -noaudio\tForce sound system to None\n");
-	printf ("  -setaudio\tForce sound system to a specific device\n");
-	printf ("    \tNULL SDL OPENAL JACK\n");
-	printf ("  -h\t\tPrint this help text\n");
-	printf ("  -y\t\tDisable automatic python script execution (pydrivers, pyconstraints, pynodes)\n");
-	printf ("  -Y\t\tEnable automatic python script execution\n");
-	printf ("  -P <filename>\tRun the given Python script (filename or Blender Text)\n");
+	printf ("  -d or --debug\n");
+	printf ("    Turn debugging on\n");
+	printf ("     * Prints every operator call and their arguments\n");
+	printf ("     * Disables mouse grab (to interact with a debugger in some cases)\n");
+	printf ("     * Keeps python sys.stdin rather then setting it to None\n\n");
+
+    printf ("  --debug-fpe\n");
+    printf ("    Enable floating point exceptions (currently linux only)\n\n");
+
+	printf ("  -nojoystick  Disable joystick support\n");
+	printf ("  -noglsl      Disable GLSL shading\n");
+	printf ("  -noaudio     Force sound system to None\n");
+	printf ("  -setaudio    Force sound system to a specific device\n");
+	printf ("                 NULL SDL OPENAL JACK\n\n");
+
+	printf ("  -h or --help\n");
+	printf ("    Print this help text\n\n");
+
+	printf ("  -Y or --enable-autoexec\n");
+	printf ("    Enable automatic python script execution (default)\n\n");
+	printf ("  -y or --disable-autoexec\n");
+	printf ("    Disable automatic python script execution (pydrivers, pyconstraints, pynodes)\n\n");
+
+	printf ("  -P or --python <filename>\t\n");
+	printf ("    Run the given Python script (filename or Blender Text)\n\n");
+
 #ifdef WIN32
-	printf ("  -R\t\tRegister .blend extension\n");
+	printf ("  -R\t\tRegister .blend extension (windows only)\n");
 #endif
-	printf ("  -v\t\tPrint Blender version and exit\n");
-	printf ("  --\t\tEnds option processing.  Following arguments are \n");
-	printf ("    \t\t   passed unchanged.  Access via Python's sys.argv\n");
+	printf ("  -v or --version\n");
+	printf ("    Print Blender version and exit.\n\n");
+
+	printf ("  --\n");
+	printf ("    Ends option processing, following arguments passed unchanged. Access via python's sys.argv\n\n");
+
 	printf ("\nEnvironment Variables:\n");
 	printf ("  $HOME\t\t\tStore files such as .blender/ .B.blend .Bfs .Blog here.\n");

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list