summaryrefslogtreecommitdiff
path: root/luasession
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-03-29 18:00:53 +0200
committerRobin Gareus <robin@gareus.org>2020-03-29 18:00:53 +0200
commit44f50914cf95dcc9887b89913ff25cd9bf31083e (patch)
tree32436657c59589ef3b8351646ccb77cbfec67ee5 /luasession
parent2ceaa98c1cf9cf5c024126e06bda2c1877e3191e (diff)
Add option to run Lua interpreter interactively from non-ttys
Diffstat (limited to 'luasession')
-rw-r--r--luasession/luasession.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/luasession/luasession.cc b/luasession/luasession.cc
index 1a6cfdcd1d..22ce141e95 100644
--- a/luasession/luasession.cc
+++ b/luasession/luasession.cc
@@ -517,9 +517,12 @@ usage ()
{
printf ("ardour-lua - interactive Ardour Lua interpreter.\n\n");
printf ("Usage: ardour-lua [ OPTIONS ] [ file [args] ]\n\n");
+/* 1 2 3 4 5 6 7 8
+ *2345678901234567890123456789012345678901234567890123456789012345678901234567890*/
printf ("Options:\n\
-h, --help display this help and exit\n\
-i, --interactive enter interactive mode after executing 'script'\n\
+ force the interpeter to behave interactively\n\
-V, --version print version information and exit\n\
\n");
printf ("\n\
@@ -584,13 +587,14 @@ main (int argc, char** argv)
if (argc > optind && 0 != strcmp (argv[optind], "-")) {
lua->do_file (argv[optind]);
- } else {
- interactive = true;
+ if (!interactive) {
+ keep_running = false;
+ }
}
- if (!interactive || !keep_running) {
+ if (!keep_running) {
/* continue to exit */
- } else if (is_tty ()) {
+ } else if (is_tty () || interactive) {
interactive_interpreter ();
} else {
luaL_dofile (lua->getState (), NULL);