Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
110
Issues
110
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
zathura
Commits
d3203905
Commit
d3203905
authored
Jun 13, 2012
by
Moritz Lipp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement :version command
parent
5ad33504
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
+51
-0
commands.c
commands.c
+41
-0
commands.h
commands.h
+9
-0
config.c
config.c
+1
-0
No files found.
commands.c
View file @
d3203905
...
...
@@ -15,6 +15,7 @@
#include "utils.h"
#include "page-widget.h"
#include "page.h"
#include "plugin.h"
#include "internal.h"
#include "render.h"
...
...
@@ -518,3 +519,43 @@ cmd_offset(girara_session_t* session, girara_list_t* argument_list)
return
true
;
}
bool
cmd_version
(
girara_session_t
*
session
,
girara_list_t
*
UNUSED
(
argument_list
))
{
g_return_val_if_fail
(
session
!=
NULL
,
false
);
g_return_val_if_fail
(
session
->
global
.
data
!=
NULL
,
false
);
zathura_t
*
zathura
=
session
->
global
.
data
;
GString
*
string
=
g_string_new
(
NULL
);
/* zathura version */
char
*
zathura_version
=
g_strdup_printf
(
"zathura %d.%d.%d"
,
ZATHURA_VERSION_MAJOR
,
ZATHURA_VERSION_MINOR
,
ZATHURA_VERSION_REV
);
g_string_append
(
string
,
zathura_version
);
g_free
(
zathura_version
);
/* plugin information */
girara_list_t
*
plugins
=
zathura_plugin_manager_get_plugins
(
zathura
->
plugins
.
manager
);
if
(
plugins
!=
NULL
)
{
GIRARA_LIST_FOREACH
(
plugins
,
zathura_plugin_t
*
,
iter
,
plugin
)
char
*
name
=
zathura_plugin_get_name
(
plugin
);
zathura_plugin_version_t
version
=
zathura_plugin_get_version
(
plugin
);
char
*
text
=
g_strdup_printf
(
"
\n
<i>(plugin)</i> %s (%d.%d.%d) <i>(%s)</i>"
,
(
name
==
NULL
)
?
"-"
:
name
,
version
.
major
,
version
.
minor
,
version
.
rev
,
zathura_plugin_get_path
(
plugin
)
);
g_string_append
(
string
,
text
);
g_free
(
text
);
GIRARA_LIST_FOREACH_END
(
plugins
,
zathura_plugin_t
*
,
iter
,
plugin
);
}
/* display information */
girara_notify
(
session
,
GIRARA_INFO
,
"%s"
,
string
->
str
);
g_string_free
(
string
,
TRUE
);
return
true
;
}
commands.h
View file @
d3203905
...
...
@@ -151,4 +151,13 @@ bool cmd_export(girara_session_t* session, girara_list_t* argument_list);
*/
bool
cmd_offset
(
girara_session_t
*
session
,
girara_list_t
*
argument_list
);
/**
* Shows version information
*
* @param session The used girara session
* @param argument_list List of passed arguments
* @return true if no error occured
*/
bool
cmd_version
(
girara_session_t
*
session
,
girara_list_t
*
argument_list
);
#endif // COMMANDS_H
config.c
View file @
d3203905
...
...
@@ -282,6 +282,7 @@ config_load_default(zathura_t* zathura)
girara_inputbar_command_add
(
gsession
,
"delmarks"
,
"delm"
,
cmd_marks_delete
,
NULL
,
_
(
"Delete the specified marks"
));
girara_inputbar_command_add
(
gsession
,
"nohlsearch"
,
"nohl"
,
cmd_nohlsearch
,
NULL
,
_
(
"Don't highlight current search results"
));
girara_inputbar_command_add
(
gsession
,
"hlsearch"
,
NULL
,
cmd_hlsearch
,
NULL
,
_
(
"Highlight current search results"
));
girara_inputbar_command_add
(
gsession
,
"version"
,
NULL
,
cmd_version
,
NULL
,
_
(
"Show version information"
));
girara_special_command_add
(
gsession
,
'/'
,
cmd_search
,
true
,
FORWARD
,
NULL
);
girara_special_command_add
(
gsession
,
'?'
,
cmd_search
,
true
,
BACKWARD
,
NULL
);
...
...
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