First time here? Check out the FAQ!

Revision history  [back]

There's no support for that level of control from the command line. However, you could write an extension script to do this. It could look at sys.argv and act accordingly. For example, if you add an arg at launch time like say 'wing9 --debug-file=/path/to/my/file.py' it will ignore the unknown arg but you can still see it with sys.argv in your script. Something like this:

import sys
import os
import wingapi

def _custom_launch_args():
  app = wingapi.gApplication

  # Prevent re-processing args if scripts are later reloaded
  if getattr(wingapi, '_processed_args', False):
    return
  wingapi._processed_args = True

  def find_filename(ftype):
    for arg in sys.argv:
      if arg.startswith(ftype):
        filename = arg[len(ftype):]
        if os.path.exists(filename):
          return filename
    return None

  filename = find_filename('--debug-file=')
  if filename is not None:
    app.OpenEditor(filename)
    app.ExecuteCommand('debug-file(show_dialog=False)')
    return

  filename = find_filename('--execute-file=')
  if filename is not None:
    app.OpenEditor(filename)
    app.ExecuteCommand('execute-file')

_custom_launch_args()

You can try this by dropping it into the 'scripts' directory below the Settings Directory reported in Wing's About box, then quit Wing and try launching with --debug-file= or --execute-file= arg. You may want to test with os.path.isabs(filename) and use os.path.abspath(filename) if not. Other than that I think the above should work.

See https://wingware.com/doc/scripting for details on scripting/extending the IDE.