Skip to content

Support Lua CLI options #1265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bigbes opened this issue Jan 10, 2016 · 5 comments
Closed

Support Lua CLI options #1265

bigbes opened this issue Jan 10, 2016 · 5 comments
Assignees
Labels
feature A new functionality
Milestone

Comments

@bigbes
Copy link
Contributor

bigbes commented Jan 10, 2016

Corresponding lua manual:

OPTIONS:
       -e stat
              execute statement stat.
       -i     enter interactive mode after executing script.
       -l name
              execute the equivalent of name=require('name') before executing script.
       -v     show version information.
       -E     ignore environment variables.
       --     stop handling options.
       -      stop handling options and execute the standard input as a file.

To add more compatibility with Lua (e.g. to support luarocks Makefile)

@bigbes bigbes added feature A new functionality needs feedback Something is unclear with the issue labels Jan 10, 2016
@kostja kostja added this to the 1.7.0 milestone Feb 18, 2016
@kostja kostja removed the needs feedback Something is unclear with the issue label Feb 18, 2016
@kostja
Copy link
Contributor

kostja commented Feb 18, 2016

LuaJIT does the same:

 % ./luajit --help
usage: ./luajit [options]... [script [args]...].
Available options are:
  -e chunk  Execute string 'chunk'.
  -l name   Require library 'name'.
  -b ...    Save or list bytecode.
  -j cmd    Perform LuaJIT control command.
  -O[opt]   Control LuaJIT optimizations.
  -i        Enter interactive mode after executing 'script'.
  -v        Show version information.
  -E        Ignore environment variables.
  --        Stop handling options.
  -         Execute stdin and stop handling options.
kostja@atlas ~/work/tarantool/third_party/luajit/src

We should at least support the common options of Lua and LuaJIT.

@kostja kostja modified the milestones: 1.7.1, 1.7.2 Jul 11, 2016
@rtsisyk rtsisyk modified the milestones: 1.8.0, 1.7.2 Aug 8, 2016
@rtsisyk
Copy link
Contributor

rtsisyk commented Aug 19, 2016

Needed for ZeroBraneStudio:

Roman Kolchin
It's own lua works fine at the same time:
Debugger server started at localhost:8172.
Program starting as '"/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/lua.app/Contents/MacOS/lua" -e "io.stdout:setvbuf('no')" "/var/folders/3r/t24hrs0x41b3q4bzc7zg8lwc0000gn/T/.chtduK"'.
Program 'lua' started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms' (pid: 14588).
Debugging session started in '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/myprograms/'.

@bigbes bigbes self-assigned this Jan 18, 2017
@bigbes bigbes modified the milestones: 1.7.4, 1.8.0 Jan 18, 2017
@bigbes
Copy link
Contributor Author

bigbes commented Jan 18, 2017

Approved by rtsisyk

@rtsisyk
Copy link
Contributor

rtsisyk commented Feb 22, 2017

This feature is nice to have for #2067.

@rtsisyk rtsisyk modified the milestones: 1.7.5, 1.7.4 Feb 22, 2017
@kostja kostja added the prio3 label Apr 17, 2017
@rtsisyk rtsisyk self-assigned this Aug 15, 2017
rtsisyk added a commit that referenced this issue Aug 17, 2017
getopt_long() is available on all supported platforms.
Get rid of legacy gopt and use getopt_long().

Incompatible changes:

 * `tarantool --version --no-such-option` printed
    "unrecognized option '--no-such-option'", now it displays version.
    `tarantool --no-such-option --version` still prints an error message.

Needed for #1265
rtsisyk added a commit that referenced this issue Aug 17, 2017
`tarantool -i SCRIPT` forces Tarantool to enter into interactive
mode after executing SCRIPT or stdin.

A part of #1265
rtsisyk added a commit that referenced this issue Aug 17, 2017
  -e EXPR - execute string 'EXPR
  -l NAME - require library 'NAME'

A part of #1265
rtsisyk added a commit that referenced this issue Aug 17, 2017
`tarantool -` now executes stdin instead of trying open "./-" script.

A part of #1265
rtsisyk added a commit that referenced this issue Aug 17, 2017
Finally fix compatibility with Lua 5.1 command-line options.

Closes #1265
rtsisyk added a commit that referenced this issue Aug 22, 2017
getopt_long() is available on all supported platforms.
Get rid of legacy gopt and use getopt_long().

Incompatible changes:

 * `tarantool --version --no-such-option` printed
    "unrecognized option '--no-such-option'", now it displays version.
    `tarantool --no-such-option --version` still prints an error message.

Needed for #1265
rtsisyk added a commit that referenced this issue Aug 22, 2017
`tarantool -i SCRIPT` forces Tarantool to enter into interactive
mode after executing SCRIPT or stdin.

A part of #1265
rtsisyk added a commit that referenced this issue Aug 22, 2017
  -e EXPR - execute string 'EXPR
  -l NAME - require library 'NAME'

A part of #1265
rtsisyk added a commit that referenced this issue Aug 22, 2017
`tarantool -` now executes stdin instead of trying open "./-" script.

A part of #1265
rtsisyk added a commit that referenced this issue Aug 22, 2017
Finally fix compatibility with Lua 5.1 command-line options.

Closes #1265
@rtsisyk
Copy link
Contributor

rtsisyk commented Aug 22, 2017

1.7.4-478-g8c2cf77ea

@rtsisyk rtsisyk closed this as completed Aug 22, 2017
rtsisyk added a commit that referenced this issue Aug 22, 2017
rtsisyk added a commit that referenced this issue Aug 22, 2017
rtsisyk added a commit that referenced this issue Sep 4, 2017
Since #1265 tarantool is fully compatible with lua5.1.
Install /usr/bin/tarantool as /usr/bin/lua alternative.

Closes #2730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality
Projects
None yet
Development

No branches or pull requests

3 participants