Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
5ebef7dc
Commit
5ebef7dc
authored
May 11, 2012
by
Alejandro Mery
Browse files
fexc: indentify optional input and output filenames from the arguments
parent
2ed5673a
Changes
1
Hide whitespace changes
Inline
Side-by-side
fexc.c
View file @
5ebef7dc
...
...
@@ -53,6 +53,7 @@ int main(int argc, char *argv[])
{
static
const
char
*
formats
[]
=
{
"fex"
,
"bin"
,
NULL
};
int
infmt
=
0
,
outfmt
=
1
;
const
char
*
filename
[]
=
{
"stdin"
,
"stdout"
};
int
app_mode
=
app_choose_mode
(
argv
[
0
]);
...
...
@@ -102,8 +103,22 @@ show_usage:
}
}
switch
(
argc
-
optind
)
{
case
2
:
filename
[
1
]
=
argv
[
optind
+
1
];
/* out */
case
1
:
if
(
strcmp
(
argv
[
optind
],
"-"
)
!=
0
)
filename
[
0
]
=
argv
[
optind
];
/* in */
case
0
:
break
;
default:
goto
show_usage
;
}
if
(
verbose
>
0
)
errf
(
"%s: %s -> %s
\n
"
,
argv
[
0
],
formats
[
infmt
],
formats
[
outfmt
]);
return
1
;
errf
(
"%s: %s:%s -> %s:%s
\n
"
,
argv
[
0
],
formats
[
infmt
],
filename
[
0
],
formats
[
outfmt
],
filename
[
1
]);
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