Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
ecdec462
Commit
ecdec462
authored
Oct 02, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added '-e' option
parent
59abeaa1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
loop.c
loop.c
+16
-0
main.c
main.c
+6
-1
No files found.
loop.c
View file @
ecdec462
...
...
@@ -91,6 +91,8 @@ static int delete_stdin_event;
extern
volatile
int
sigterm_cnt
;
extern
char
*
start_command
;
static
void
stdin_read_callback_all
(
int
arg
,
short
what
,
struct
event
*
self
)
{
if
(
!
readline_disabled
)
{
if
(((
long
)
arg
)
&
1
)
{
...
...
@@ -852,6 +854,20 @@ int loop (void) {
lua_diff_end
();
#endif
if
(
start_command
)
{
safe_quit
=
1
;
while
(
*
start_command
)
{
char
*
start
=
start_command
;
while
(
*
start_command
&&
*
start_command
!=
'\n'
)
{
start_command
++
;
}
if
(
*
start_command
)
{
*
start_command
=
0
;
start_command
++
;
}
interpreter_ex
(
start
,
0
);
}
}
/*tgl_do_get_dialog_list (get_dialogs_callback, 0);
if (wait_dialog_list) {
...
...
main.c
View file @
ecdec462
...
...
@@ -111,6 +111,7 @@ int readline_disabled;
int
disable_output
;
int
reset_authorization
;
int
port
;
char
*
start_command
;
void
set_default_username
(
const
char
*
s
)
{
if
(
default_username
)
{
...
...
@@ -436,6 +437,7 @@ void usage (void) {
printf
(
" -D disable output
\n
"
);
printf
(
" -P <port> port to listen for input commands
\n
"
);
printf
(
" -S <socket-name> unix socket to create
\n
"
);
printf
(
" -e <commands> make commands end exit
\n
"
);
exit
(
1
);
}
...
...
@@ -538,7 +540,7 @@ char *unix_socket;
void
args_parse
(
int
argc
,
char
**
argv
)
{
int
opt
=
0
;
while
((
opt
=
getopt
(
argc
,
argv
,
"u:hk:vNl:fEwWCRdL:DU:G:qP:S:"
while
((
opt
=
getopt
(
argc
,
argv
,
"u:hk:vNl:fEwWCRdL:DU:G:qP:S:
e:
"
#ifdef HAVE_LIBCONFIG
"c:p:"
#else
...
...
@@ -627,6 +629,9 @@ void args_parse (int argc, char **argv) {
case
'S'
:
unix_socket
=
optarg
;
break
;
case
'e'
:
start_command
=
optarg
;
break
;
case
'h'
:
default:
usage
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment