Re: Command line args (was: API Changes)

From: Robert <ro....at.web.de>
Date: Sat, 19 Jun 2010 12:35:16 +0200

Mitchell,

On Fri, Jun 18, 2010 at 5:52 PM, mitchell <mforal.n....at.gmail.com> wrote:
> Sorry. Clearly I didn't do testing before creating that patch. Does
> the following patch give the desired behavior? The session module now
> checks for -n if the arg_none event is emitted (it didn't previously,
> resulting in the loading/saving of sessions)
>
thanks, that works great - the way it is now it is not possible any
more to "overwrite" your session if you close a Textadept instance and
have opened another instance from the command line. Further it's not
necessary to convert the file name to its full path (as it is not
saved in a session file). If you did for example (with the old
behaviour)
./textadept init.lua
and later started Textadept from somewhere else, init.lua couldn't be found.

> By the way, with dynamic args, I'd like to keep any module-specific
> code out of init.lua.

Of course, this is better - as for the "arg_none" to me (non native
speaker) the distinction between a switch and an argument wasn't so
clear. (So "files_none" would be easier to understand, but I think
it's just fine.)

Below a correction and suggestion.

Robert

----
Line 14 in session.lua:
--   disabled by passing the command line switch '-n' or '--no-session' to
to
--   disabled by passing the command line switch '-n' or '--nosession' to
In args.lua
Changing the dialog box informative text to the title:
  gui.dialog('textbox',
             '--title', 'Command line parameters',
             '--text', table.concat(help, '\n'),
             '--button1', 'gtk-ok')
Received on Sat 19 Jun 2010 - 06:35:16 EDT

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