diff options
author | Martin Szulecki | 2010-05-25 17:55:05 +0200 |
---|---|---|
committer | Martin Szulecki | 2010-05-25 17:55:05 +0200 |
commit | cbf65ca13b37eb156a6d755824a4ff6bc298e063 (patch) | |
tree | 4090ca87707b7ae7dd3c4afacaf4c8c02c55b11c /src | |
parent | a6cc713fb8fe564fc619169c5a0e462220a6ec3a (diff) | |
download | idevicerestore-cbf65ca13b37eb156a6d755824a4ff6bc298e063.tar.gz idevicerestore-cbf65ca13b37eb156a6d755824a4ff6bc298e063.tar.bz2 |
Pass IPSW filename as mandatory argument
Diffstat (limited to 'src')
-rw-r--r-- | src/idevicerestore.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index 27cc161..5f3e95e 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) { char* ipsw = NULL; char* uuid = NULL; uint64_t ecid = 0; - while ((opt = getopt(argc, argv, "vdhi:u:")) > 0) { + while ((opt = getopt(argc, argv, "vdhu:")) > 0) { switch (opt) { case 'h': usage(argc, argv); @@ -73,10 +73,6 @@ int main(int argc, char* argv[]) { idevicerestore_debug = 3; break; - case 'i': - ipsw = optarg; - break; - case 'u': uuid = optarg; break; @@ -87,6 +83,12 @@ int main(int argc, char* argv[]) { } } + argc -= optind; + argv += optind; + + if (argc == 1) + ipsw = argv[0]; + if (ipsw == NULL) { error("ERROR: Please supply an IPSW\n"); return -1; @@ -394,14 +396,12 @@ void device_callback(const idevice_event_t* event, void *user_data) { void usage(int argc, char* argv[]) { char *name = strrchr(argv[0], '/'); - printf("Usage: %s [OPTIONS]\n", (name ? name + 1 : argv[0])); - printf("Restore firmware and filesystem to iPhone/iPod Touch.\n"); + printf("Usage: %s [OPTIONS] FILE\n", (name ? name + 1 : argv[0])); + printf("Restore/upgrade IPSW firmware FILE to an iPhone/iPod Touch.\n"); printf(" -d, \t\tenable communication debugging\n"); - printf(" -v, \t\tenable incremental levels of verboseness\n"); - //printf(" -r, \t\tput device into recovery mode\n"); - printf(" -i, \t\ttarget filesystem to install onto device\n"); printf(" -u, \t\ttarget specific device by its 40-digit device UUID\n"); printf(" -h, \t\tprints usage information\n"); + printf(" -v, \t\tenable incremental levels of verboseness\n"); printf("\n"); exit(1); } |