Re: Command line args (was: API Changes)

From: Robert <>
Date: Fri, 18 Jun 2010 13:25:48 +0200

On Thu, Jun 17, 2010 at 11:40 PM, mitchell <> wrote:
> Hi,
> I have just committed changes for dynamic command line argument
> handling. Modules can implement and handle their own switches.
> Documentation is here:
> See core/args.lua and modules/textadept/session.lua for examples.

Awesome. I had wondered whether it would be possible to have dynamic
commands like this.

> There is now support for changing _USERHOME from the command line
> thanks to Robert.

Unfortunately, the _USERHOME is not saved in a reset. That's why I was
processing the arguments again (I couldn't find another way).
Not removing seems to work for userhome:
Line 82 in core/args.lua
  if (arg[i] == '-u' or arg[i] == '--userhome') and arg[i + 1] then
-- userhome = table.remove(arg, i + 1)
-- table.remove(arg, i)
    userhome = arg[i+1]

However, I think the reset problem would be the same for (potential)
switches in user modules.
Maybe the "process" function should be called every time and filenames
be removed from the args list?
Is it possible to use reset_before/reset_after events for passing
information around?

Received on Fri 18 Jun 2010 - 07:25:48 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:48:18 EST