summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2007-07-13 17:12:22 -0700
committerGeoff Levand <geoffrey.levand@am.sony.com>2007-07-13 17:12:22 -0700
commitb1e05997955d51deaf54c8dbfd361c2b0514647b (patch)
tree0d6be3d882dfbf51a566593f5ba0513461733077
parent113be90d42639e2c3547c1769dbf97b4002840c6 (diff)
downloadps3-utils-b1e05997955d51deaf54c8dbfd361c2b0514647b.tar.gz
ps3-flash-util.c: Add '-h' option, default (no flags) to display help
-rw-r--r--ps3-flash-util.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ps3-flash-util.c b/ps3-flash-util.c
index 843a337..daab943 100644
--- a/ps3-flash-util.c
+++ b/ps3-flash-util.c
@@ -52,6 +52,7 @@ static void print_usage_exit(int r)
puts(" " PS3_UTILS_APP_NAME " -d");
puts("");
puts("Options:");
+ puts(" -h print this message");
puts(" -s show current settings");
puts(" -d print difference of clock time between game os and linux");
puts(" -b change boot flag : boot game os");
@@ -266,13 +267,15 @@ int main(int argc, char *argv[])
uint8_t *ldr_buf = NULL;
unsigned long ldr_size = 0;
-
/* parse options */
if (argc < 1) {
print_usage_exit(1);
}
+ if (argc == 1)
+ print_usage_exit(0);
+
for (i = 1; i < argc; i++) {
p = argv[i];
if (*p == '-') {
@@ -291,11 +294,11 @@ int main(int argc, char *argv[])
if (n_flag >= 0)
print_usage_exit(1);
n_flag = 0;
- } else if (*p == 'B') {
+ } else if (*p == 'B') {
if (n_flag >= 0)
print_usage_exit(1);
n_flag = 1;
- } else if (*p == 's') {
+ } else if (*p == 's') {
if (b_show > 0)
print_usage_exit(1);
b_show = 1;
@@ -307,10 +310,13 @@ int main(int argc, char *argv[])
if (n_format >= 0)
print_usage_exit(1);
n_format = 1;
- } else if (*p == 'r') {
+ } else if (*p == 'r') {
if (n_format >= 0)
print_usage_exit(1);
n_format = 0;
+ } else if (*p == 'h') {
+ print_usage_exit(0);
+ n_format = 0;
} else {
printf("unknown option: -%s\n", p);
print_usage_exit(1);