Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
feh
Commits
69b1fd25
Commit
69b1fd25
authored
14 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Parse commandline options _after_ theme options (closes GH-23)
parent
718a2f4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
man/feh.pre
+2
-2
2 additions, 2 deletions
man/feh.pre
src/options.c
+26
-4
26 additions, 4 deletions
src/options.c
with
28 additions
and
6 deletions
man/feh.pre
+
2
−
2
View file @
69b1fd25
...
@@ -361,8 +361,8 @@ Load options from config file with name
...
@@ -361,8 +361,8 @@ Load options from config file with name
.Ar theme
.Ar theme
- see
- see
.Sx THEMES CONFIG SYNTAX
.Sx THEMES CONFIG SYNTAX
for more info. Note that
options from the theme file always override
for more info. Note that
commandline options always override theme options.
commandline options.
The theme can also be set via the program name
The theme can also be set via the program name
.Pq e.g. with symlinks ,
.Pq e.g. with symlinks ,
so by default
so by default
.Nm
.Nm
...
...
This diff is collapsed.
Click to expand it.
src/options.c
+
26
−
4
View file @
69b1fd25
...
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
...
@@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
"options.h"
#include
"options.h"
static
void
check_options
(
void
);
static
void
check_options
(
void
);
static
void
feh_getopt_theme
(
int
argc
,
char
**
argv
);
static
void
feh_parse_option_array
(
int
argc
,
char
**
argv
);
static
void
feh_parse_option_array
(
int
argc
,
char
**
argv
);
static
void
feh_parse_environment_options
(
void
);
static
void
feh_parse_environment_options
(
void
);
static
void
feh_check_theme_options
(
int
arg
,
char
**
argv
);
static
void
feh_check_theme_options
(
int
arg
,
char
**
argv
);
...
@@ -93,13 +94,15 @@ void init_parse_options(int argc, char **argv)
...
@@ -93,13 +94,15 @@ void init_parse_options(int argc, char **argv)
/* Check for and parse any options in FEH_OPTIONS */
/* Check for and parse any options in FEH_OPTIONS */
feh_parse_environment_options
();
feh_parse_environment_options
();
D
((
"About to parse commandline options
\n
"
));
feh_getopt_theme
(
argc
,
argv
);
/* Parse the cmdline args */
feh_parse_option_array
(
argc
,
argv
);
D
((
"About to check for theme configuration
\n
"
));
D
((
"About to check for theme configuration
\n
"
));
feh_check_theme_options
(
argc
,
argv
);
feh_check_theme_options
(
argc
,
argv
);
D
((
"About to parse commandline options
\n
"
));
/* Parse the cmdline args */
feh_parse_option_array
(
argc
,
argv
);
/* If we have a filelist to read, do it now */
/* If we have a filelist to read, do it now */
if
(
opt
.
filelistfile
)
{
if
(
opt
.
filelistfile
)
{
/* joining two reverse-sorted lists in this manner works nicely for us
/* joining two reverse-sorted lists in this manner works nicely for us
...
@@ -318,8 +321,27 @@ char *feh_string_normalize(char *str)
...
@@ -318,8 +321,27 @@ char *feh_string_normalize(char *str)
return
(
estrdup
(
ret
));
return
(
estrdup
(
ret
));
}
}
static
void
feh_parse_option_array
(
int
argc
,
char
**
argv
)
static
void
feh_getopt_theme
(
int
argc
,
char
**
argv
)
{
static
char
stropts
[]
=
"-T:"
;
static
struct
option
lopts
[]
=
{
{
"theme"
,
1
,
0
,
'T'
},
{
0
,
0
,
0
,
0
}
};
int
optch
=
0
,
cmdx
=
0
;
opterr
=
0
;
while
((
optch
=
getopt_long
(
argc
,
argv
,
stropts
,
lopts
,
&
cmdx
))
!=
EOF
)
{
if
(
optch
==
'T'
)
theme
=
estrdup
(
optarg
);
}
opterr
=
1
;
optind
=
0
;
}
static
void
feh_parse_option_array
(
int
argc
,
char
**
argv
)
{
{
static
char
stropts
[]
=
static
char
stropts
[]
=
"a:A:b:B:cC:dD:e:E:f:Fg:GhH:iIj:J:kK:lL:mM:nNo:O:pPqQrR:sS:tT:uUvVwW:xXy:YzZ"
"a:A:b:B:cC:dD:e:E:f:Fg:GhH:iIj:J:kK:lL:mM:nNo:O:pPqQrR:sS:tT:uUvVwW:xXy:YzZ"
...
...
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