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
b1b4cd8b
Commit
b1b4cd8b
authored
Nov 30, 2013
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface: added auto-completion for modifiers (only [offline] for now)
parent
ef8de029
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
interface.c
interface.c
+15
-1
No files found.
interface.c
View file @
b1b4cd8b
...
...
@@ -43,7 +43,7 @@
#include "mtproto-common.h"
#define ALLOW_MULT 1
//
#define ALLOW_MULT 1
char
*
default_prompt
=
"> "
;
int
unread_messages
;
...
...
@@ -247,6 +247,11 @@ void update_prompt (void) {
print_end
();
}
char
*
modifiers
[]
=
{
"[offline]"
,
0
};
char
*
commands
[]
=
{
"help"
,
"msg"
,
...
...
@@ -339,6 +344,8 @@ int commands_flags[] = {
07
,
};
int
get_complete_mode
(
void
)
{
line_ptr
=
rl_line_buffer
;
int
l
=
0
;
...
...
@@ -348,6 +355,9 @@ int get_complete_mode (void) {
r
=
next_token
(
&
l
);
if
(
!
r
)
{
return
0
;
}
}
if
(
*
r
==
'['
&&
!
r
[
l
])
{
return
6
;
}
if
(
!*
line_ptr
)
{
return
0
;
}
char
**
command
=
commands
;
...
...
@@ -485,6 +495,10 @@ char *command_generator (const char *text, int state) {
index
=
complete_encr_chat_list
(
index
,
text
,
len
,
&
R
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
case
6
:
index
=
complete_string_list
(
modifiers
,
index
,
text
,
len
,
&
R
);
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
R
;
default:
if
(
c
)
{
rl_line_buffer
[
rl_point
]
=
c
;
}
return
0
;
...
...
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