nm - Runs NeXtMidas

  nm [options]*                     - Starts the interactive NeXtMidas shell.
  nm [options]*  command [param]*   - Runs the given command in one-shot mode.
  nm [options]* "command [param]*"  - Same as above (quotes are optional).
  nm [options]* 'command [param]*'  - Same as above (tics are optional).

  It is important to note that quotes ("...") may be stripped off by some OS
  shells before they get into the NeXtMidas session. One way to work around
  this (in Unix) is to add extra single-tic quotes ('...') around the entire
  command line. For example, rather than using this:

    $ nm mycommand "jdbc:oracle:thin@host:port:stuff" "user" "pass"

  Use this:

    $ nm 'mycommand "jdbc:oracle:thin@host:port:stuff" "user" "pass"'
         ^                                                          ^

Operating System Environment Variables:
  NM_BOOT_CP_APPEND                                      (Since NeXtMidas 2.9.3)
      Append to the JVM's boot CLASSPATH. For advanced NeXtMidas usage only.
      Since NeXtMidas 3.4.0, wildcards with the asterisk char (*) are supported
      in the basename. This is done by passing it to java via -classpath option.
      Java will then expand the * to list of files with .jar or .JAR extension.
      For example (use quotes to prevent shell from expanding the * char):
        setenv NM_BOOT_CP_APPEND "/path/to/myjavalibs/*:/another/dir/*"

  NM_CC                                                  (Since NeXtMidas 2.9.2)
      Override the native C compiler specified in build.props.

  NM_CC_OPTIONS                                          (Since NeXtMidas 2.9.2)
      Additional C compiler flags/options to append to end of compile flags.
      For advanced NeXtMidas usage only.

  NM_CXX                                                 (Since NeXtMidas 2.9.2)
      Override the native C++ compiler specified in build.props.

  NM_CXX_OPTIONS                                         (Since NeXtMidas 2.9.2)
      Additional C++ compiler flags/options to append to end of compile flags.
      For advanced NeXtMidas usage only.

  NM_COMPLETION_AUX_EXCLUDE                              (Since NeXtMidas 3.1.0)
      Seed for list of pipe ('|') separated AUXs to be excluded when using the
      FILES command or tab-completion at the terminal when a NeXtMidas session
      is first started. This seed list takes precedence over the
      -DCOMPLETIONAUXEXCLUDE system property.
      NOTE: Subsequent
        "nM> ENVIRONMENT set COMPLETIONAUXEXCLUDE <list>" will override this.

  NM_FORTRAN
      Override the native Fortran (for XBC) compiler specified in build.props.

  NMHISTORY_DIR                                          (Since NeXtMidas 2.9.2)
      Allows users to override the default NMSF directory location.

  NM_STARTUP_MACRO                                       (Since NeXtMidas 3.1.3)
      Allows users to override the default user-level startup macro under HOME.
      This is equivalent to the -DNMSTARTUP.USER= option that can be put into
      the NM_USER_JVM_FLAGS environment variable. This has higher precedence.

  NM_USER_JVM_FLAGS
      Allows users to specify a list of Java Virtual Machine options that will
      get passed to the JVM when NeXtMidas runs.

  NM_USER_CP
      Allows users to append to the CLASSPATH (after $NMROOT, SYS's dependent
      jars, and option trees in the path when the JVM is initially started).
      Prior to NeXtMidas 2.9.3, this was appended right after $NMROOT and SYS's
      jars, use NM_USER_CP_AFTER_SYS if you desire this legacy behavior.

      Note that (in Unix C Shell, for example):
        setenv NM_USER_CP <classpath>
      is equivalent to:
        setenv NM_USER_JVM_FLAGS -DCLASSPATH=<classpath>

      Also note that in the above example, if BOTH the NM_USER_CP and
      NM_USER_JVM_FLAGS (with -DCLASSPATH=..) environment variables are set,
      the NM_USER_CP has precedence.

  NM_USER_CP_AFTER_SYS                                   (Since NeXtMidas 2.9.3)
      Allows users to append to the CLASSPATH right after $NMROOT and SYS's jars
      but before any other option tree on path.
      For advanced NeXtMidas usage only.

  NM_USER_CP_PREPEND                                     (Since NeXtMidas 2.9.3)
      Allows users to prepend to the CLASSPATH (before $NMROOT).
      For advanced NeXtMidas usage only.

      This is equivalent to the -DCLASSPATHPREPEND= option that can be put into
      the NM_USER_JVM_FLAGS environment variable. This has higher precedence.


Runtime options for NeXtMidas:
  -CLASSLOADERDEBUG=[TRUE|FALSE]
      Turns on debugging of the class loader (TRUE). This lists all of the
      elements added to the classpath by the NmClassLoader as they are added.
      This produces a lot of output, but is useful when debugging classloader
      issues.

  -H or -HELP
      Displays this message and exits.

  -I or -INDEPENDENT
      Runs NeXtMidas in "independent" mode. This allows NeXtMidas to be
      run directly without the need to use "nmstart", "nmend" or even
      the "nm" script.

      Note that the use of this option will turn on the following dependent
      options:
        -DNOEXTERNAL=TRUE
        -DNMSF=NULL
        -DSHELL=nxm.sys.lib.Shell
        -DNMROOT=[Based on Classpath]
        -DJAVAHOME=[Based on Java VM]

      EXAMPLES:
        #1: ${JAVA_HOME}/bin/java -classpath ${NMROOT}/tools/ NmClassLoader
                   -INDEPENDENT mymacro param1 param2

        #2: /opt/jdk1.7.0_79/bin/java -classpath /home/smith/nxm360/tools/
                   NmClassLoader -I "mymacro param1 param2"

      WARNING:
        The classpath passed into java must be equal to "${NMROOT}/tools/" (see
        example #1) or may be the full path to $NMROOT/tools/ (see example #2).
        It may not be anything else and may NOT include any other classpath
        elements. You must use -DCLASSPATH=[classpath] to add additional
        elements to the classpath. This is because the NMROOT property will
        be automatically determined based on the Java classpath.

  -LOG_OUT=file
      Saves a copy of all output to System.out to a named file.

  -LOG_ERR=file
      Saves a copy of all output to System.err to a named file.

  -LOG_ALL=file
      Saves a copy of all output to System.out or System.err to a named file.

  -V or -VERSION
      Displays the NeXtMidas version information and exits. This is the same as
      using:
        nm VERSION/ALL SYS


Runtime options via Java system properties for NeXtMidas:
  -DBUGFIX.id=[ON|OFF|AUTO]
      BUGFIX: Turns on or off a bug fix indicated by "id". Default is "AUTO"
      (NeXtMidas turns the fix on/off based on OS/Java version).

      Please see the javadoc file for nxm.sys.inc.Installation.ApplyBugFix for
      a list of current bug fixes. Note that the list may change significantly
      in future releases (during a beta series) as they are temporary
      workarounds to enable "broken behavior" for backwards compatibility.

      Note: Unknown (or removed) BUGFIX.<id> properties are ignored.

  -DCOMPLETIONAUXEXCLUDE=[AUX1|AUX2|...]                 (Since NeXtMidas 3.1.1)
      Seed for list of pipe ('|') separated AUXs to be excluded when using the
      FILES command or tab-completion at the terminal when a NeXtMidas session
      is first started. Note, that the OS environment NM_COMPLETION_AUX_EXCLUDE
      property takes precedence over this seed list.
      NOTE: Subsequent
        "nM> ENVIRONMENT set COMPLETIONAUXEXCLUDE <list>" will override this.

  -DHEADLESS=[AUTO|TRUE|FALSE]
      HEADLESS: Forces NeXtMidas to run in headless mode (TRUE) or not to run
      in headless mode (FALSE). If this option is omitted Java will
      automatically determine if the system is headless (AUTO). However, the
      methods Java uses to determine if the system is headless may cause an X11
      warning on older Linux versions.

  -DGRAPHICS=[ENV.GRAPHICS options]                      (Since NeXtMidas 2.9.1)
      Set the graphics options (found in Theme.java) to allow control over the
      method NeXtMidas uses and displays certain items such as PLOTs and
      widgets. See ENVIONMENTS explain, under GRAPHICS section for more info.
      so
        -DGRAPHICS=+HEADLESS (same as -DHEADLESS=TRUE)
      and
        -DGRAPHICS=+INITONLOAD (force graphics/theme initialization on load for
                                non-Midas graphics to use Midas themes)
      and
        -DGRAPHICS=SWING|SWINGDB (use SWING graphics and SWING double buffering)

  -DGRAPHICSDELAY=[seconds]                              (Since NeXtMidas 3.1.0)
      Set a delay (in seconds) which pauses the initial graphics initialization
      for the specified time. This was added to mitigate a Java Bug where the
      JVM and the macro use the same resources and the Java Swing thread gets
      deadlocked.

  -DNATIVELIBSUFFIX=[e.g. "_rhel5-32bit", etc.]          (Since NeXtMidas 2.9.2)
      Set the native library suffix to use (overriding the default of
      "_<ostag><arch>" for loading native libraries. This should NOT include
      the file extension (e.g. .so). For advanced NeXtMidas usage only.

  -DNMSF=NULL
      NMSF: Set this to prevent a NeXtMidas Save File (NMSF) from being
      created. Use of this option will cause all NeXtMidas settings to be reset
      any time an OS command is used.

  -DNOEXTERNAL=TRUE
      NOEXTERNAL: Prevents NeXtMidas from automatically running OS commands in
      "external" mode (where it turns control over to the OS shell in order to
      run any OS commands) and forces them to run in "internal" mode (where
      each OS command is launched in a separate process via Java).

      This setting can be overridden at any time by using the the "$" or "$$"
      prefix (see the "Metacharacters" section of the "NeXtMidas User's Guide"
      for details).

  -DNONATIVE=TRUE
      NONATIVE: Disables use of native code in the NeXtMidas libraries. Use of
      this will disable some of the key-bindings in the shell (i.e. the arrows
      will not work) but will make it easier to debug memory issues.

      This can be used to allow NeXtMidas to run even if the native libraries
      are not available (e.g. on a system without a C/C++ compiler).

Runtime options via Java system properties for use by advanced NeXtMidas users:
  -DCLASSPATH=classpath
      CLASSPATH: Appends to the classpath (after $NMROOT, SYS's jars, and option
      trees on the path on JVM startup). Multiple entries should be
      comma-separated. This only applies when using the default NeXtMidas class
      loader (NmClassLoader).
      NOTE: Use -DCLASSPATHAFTERSYS for legacy behavior prior to NeXtMidas 2.9.3

  -DCLASSPATHAFTERSYS=classpath                          (Since NeXtMidas 2.9.3)
      CLASSPATHAFTERSYS: Appends to the classpath (after $NMROOT and SYS's jars
      but before any option tree on path). This only applies when using the
      default NeXtMidas class loader (NmClassLoader).

  -DCLASSPATHPREPEND=classpath                           (Since NeXtMidas 2.9.3)
      CLASSPATHPREPEND: Prepends to the classpath (before $NMROOT).
      Multiple entries should be comma-separated. This only applies when
      using the default NeXtMidas class loader (NmClassLoader).

  -DCONFIGURE=TRUE (internal usage only)
      CONFIGURE=TRUE: Runs %nmstartup script(s) then exits.

  -DHOME=homedir
      HOME: Sets the user's home directory.

  -DJAVAHOME=javahome
      JAVAHOME: Sets the home directory for Java. Must end in a path separator
      and must match the Java version being used (specified via the $JAVAHOME
      OS env).

      In most cases it is best to let NeXtMidas determine this automatically
      based on the Java VM that is being used.

  -DNMPID=pid
      NMPID: Sets the PID to use inside NeXtMidas.

  -DNMROOT=nmroot
      NMROOT: Sets NMROOT. Must end in a path separator.

  -DNMSF=file
      NMSF: Sets the NMSF file to use.

  -DNMSTARTUP.SYS=macro                                  (Since NeXtMidas 3.1.3)
      System-level startup macro to run instead of SYS's nmstartup.mm under
      ${NMROOT}/nxm/sys/cfg. Use an absolute path, the "nxm" dot syntax, a URL,
      or macro;opt (in mcr area) to specify a system-level startup macro
      outside the SYS cfg area.

      If this is not set or is set to "default", then the default behavior runs
      SYS's nmstartup.mm under normal and -INDEPENDENT run modes.

      If this is set to blank or "none", then no system-level startup macro is
      executed (i.e. SYS's nmstartup.mm is skipped).

      Note: Java Web Start since client machines normally do not have the same
            disk configurations as server machines. Use NMSTARTUP.USER to point
            to desired startup macro for client machines.
            It is also skip by default when running via nxm.sys.lib.NeXtMidas.
            When using nxm.sys.lib.NeXtMidas, the -script=macro option can be
            used to get the same effect (except that it does NOT support the
            macro;opt syntax).

      See NMSTARTUP.USER for example macro syntaxes.

  -DNMSTARTUP.USER=macro                                 (Since NeXtMidas 3.1.3)
      User/application-level startup macro/script to run instead of nmstartup.mm
      under HOME AUX. Use an absolute path, the "nxm" dot syntax, a URL, or
      macro;opt (in mcr area) to specify a startup macro outside the HOME AUX.
      The user-level startup macro is executed after the system-level startup.

      If this is not set, then the default behavior runs the user-level
      nmstartup.mm from the HOME AUX under normal run mode. This is skipped by
      default in all other run modes (e.g. -INDEPENDENT, Web Start,
      nxm.sys.lib.NeXtMidas) unless specified otherwise.

      If this is set to "default", then the default behavior runs the user-level
      nmstartup.mm from the HOME AUX.

      If this is set to blank of "none", then no user-level startup macro is
      executed (i.e. the USER nmstartup.mm is skipped).

      EXAMPLES:
        0. -DNMSTARTUP.USER=default        (nmstartup.mm in HOME AUX)
        1. -DNMSTARTUP.USER=custom_startup (custom_startup.mm in HOME AUX)
        2. -DNMSTARTUP.USER=/path/to/custom/startup_macro.mm
        3. -DNMSTARTUP.USER=nxm.ucl.cfg.startup_macro.mm (in CFG area of UCL)
        4. -DNMSTARTUP.USER=http://server/path/to/startup_macro.mm
        5. -DNMSTARTUP.USER="startup_macro;ucl" (in MCR area of UCL)
            NOTE: make sure to escape the semi-colon and/or surround by quotes
            for your appropriate OS shell when using the macro;opt syntax.

  -DREBUILDCLASSPATH=TRUE                                (Since NeXtMidas 2.9.3)
      Rebuild classpath entries of NeXtMidas PATH on bootup of Shell vs loading
      it from OPT.CLASSPATH table. Defaults to loading classpath entries from
      OPT.CLASSPATH (from previous instance) when JVM is re-entered [DEF=FALSE].

  -DSHELL=classname
      SHELL: Sets the class name of the NeXtMidas shell.

      This is usually set to "nxm.sys.lib.Shell".

  -DUSER=username
      USER: Sets the username of the user.


These commands do NOT support any of the runtime options listed above:
   nm make
   nm edit
   nm end


Common Runtime options for Java VM:
  -Xms<n>
      Set initial heap size for JVM (e.g. -Xms128m for 128MB starting memory)

  -Xmx<n>
      Set maximum heap size for JVM (e.g. -Xmx256m for 256MB maximum memory)

  -Dproperty=value
      Set a system property value. e.g. -Djava.net.preferIPv4Stack=true


Any of the -D options set in the NM_USER_JVM_FLAGS environment variable will be
included each time NeXtMidas is run.
  Note 1: NM_USER_JVM_FLAGS must be set before running nmstart.
  Note 2: NM_USER_JVM_FLAGS -DCLASSPATH=<classpath> option will get overridden
          by NM_USER_CP if both are present.
  Note 3: On Windows, the runtime options will need to be quoted if given on
          the command line (e.g. c:\> nm "-DNONATIVE=TRUE").

