Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
xfce4-dict
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Apps
xfce4-dict
Commits
3b4d8dd0
Commit
3b4d8dd0
authored
16 years ago
by
Enrico Tröger
Browse files
Options
Downloads
Patches
Plain Diff
Add "-h" command line option if GLib supports printing the help text.
(Old svn revision: 4578)
parent
0419b871
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+1
-0
1 addition, 0 deletions
ChangeLog
src/xfce4-dict.c
+20
-3
20 additions, 3 deletions
src/xfce4-dict.c
with
21 additions
and
3 deletions
ChangeLog
+
1
−
0
View file @
3b4d8dd0
...
...
@@ -2,6 +2,7 @@
* Update Readme.
* Reformat ChangeLog.
* Add "-h" command line option if GLib supports printing the help text.
2008-04-14 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
...
...
This diff is collapsed.
Click to expand it.
src/xfce4-dict.c
+
20
−
3
View file @
3b4d8dd0
...
...
@@ -38,6 +38,9 @@
#include
"popup_plugin.h"
#if GLIB_CHECK_VERSION(2,14,0)
static
gboolean
show_help
=
FALSE
;
#endif
static
gboolean
show_version
=
FALSE
;
static
gboolean
focus_panel_entry
=
FALSE
;
static
gboolean
mode_dict
=
FALSE
;
...
...
@@ -46,11 +49,14 @@ static gboolean mode_spell = FALSE;
static
GOptionEntry
cli_options
[]
=
{
{
"dict"
,
'd'
,
0
,
G_OPTION_ARG_NONE
,
&
mode_dict
,
N_
(
"Search the given text using a DICTD server"
),
NULL
},
#if GLIB_CHECK_VERSION(2,14,0)
{
""
,
'h'
,
0
,
G_OPTION_ARG_NONE
,
&
show_help
,
"dummy"
,
NULL
},
#endif
{
"dict"
,
'd'
,
0
,
G_OPTION_ARG_NONE
,
&
mode_dict
,
N_
(
"Search the given text using a Dict server(RFC 2229)"
),
NULL
},
{
"web"
,
'w'
,
0
,
G_OPTION_ARG_NONE
,
&
mode_web
,
N_
(
"Search the given text using a web-based search engine"
),
NULL
},
{
"spell"
,
's'
,
0
,
G_OPTION_ARG_NONE
,
&
mode_spell
,
N_
(
"Check the given text with a spellchecker"
),
NULL
},
{
"text-field"
,
't'
,
0
,
G_OPTION_ARG_NONE
,
&
focus_panel_entry
,
N_
(
"Grab the focus on the text field in the panel"
),
NULL
},
{
"version"
,
'v'
,
0
,
G_OPTION_ARG_NONE
,
&
show_version
,
N_
(
"Show version
and exit
"
),
NULL
},
{
"version"
,
'v'
,
0
,
G_OPTION_ARG_NONE
,
&
show_version
,
N_
(
"Show version
information
"
),
NULL
},
{
NULL
,
0
,
0
,
0
,
NULL
,
NULL
,
NULL
}
};
//~ If called without any options, the xfce4-dict-plugin main window is shown.
...
...
@@ -111,11 +117,22 @@ gint main(gint argc, gchar *argv[])
g_option_group_set_translation_domain
(
g_option_context_get_main_group
(
context
),
GETTEXT_PACKAGE
);
g_option_context_add_group
(
context
,
gtk_get_option_group
(
FALSE
));
g_option_context_parse
(
context
,
&
argc
,
&
argv
,
NULL
);
g_option_context_free
(
context
);
gtk_init
(
&
argc
,
&
argv
);
gtk_window_set_default_icon_name
(
"xfce4-dict"
);
#if GLIB_CHECK_VERSION(2,14,0)
if
(
show_help
)
{
gchar
*
help_text
=
g_option_context_get_help
(
context
,
TRUE
,
NULL
);
printf
(
"%s
\n
"
,
help_text
);
g_free
(
help_text
);
g_option_context_free
(
context
);
exit
(
0
);
}
#endif
g_option_context_free
(
context
);
if
(
show_version
)
{
printf
(
PACKAGE
" "
VERSION
" "
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment