Added -V, --version option
This commit is contained in:
parent
1fe3ce5244
commit
2c99d25d53
14
ios-deploy.c
14
ios-deploy.c
@ -15,6 +15,7 @@
|
|||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include "MobileDevice.h"
|
#include "MobileDevice.h"
|
||||||
|
|
||||||
|
#define APP_VERSION "1.0.2"
|
||||||
#define PREP_CMDS_PATH "/tmp/fruitstrap-lldb-prep-cmds-"
|
#define PREP_CMDS_PATH "/tmp/fruitstrap-lldb-prep-cmds-"
|
||||||
#define LLDB_SHELL "python -u -c \"import time; time.sleep(0.5); print 'run'; time.sleep(2000000)\" | lldb -s " PREP_CMDS_PATH
|
#define LLDB_SHELL "python -u -c \"import time; time.sleep(0.5); print 'run'; time.sleep(2000000)\" | lldb -s " PREP_CMDS_PATH
|
||||||
|
|
||||||
@ -746,10 +747,15 @@ void usage(const char* app) {
|
|||||||
" -x, --gdbexec <file> GDB commands script file\n"
|
" -x, --gdbexec <file> GDB commands script file\n"
|
||||||
" -n, --nostart do not start the app when debugging\n"
|
" -n, --nostart do not start the app when debugging\n"
|
||||||
" -v, --verbose enable verbose output\n"
|
" -v, --verbose enable verbose output\n"
|
||||||
" -m, --noinstall directly start debugging without app install (-d not required) \n",
|
" -m, --noinstall directly start debugging without app install (-d not required) \n"
|
||||||
|
" -V, --version print the executable version \n",
|
||||||
app);
|
app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void show_version() {
|
||||||
|
printf("%s\n", APP_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
static struct option longopts[] = {
|
static struct option longopts[] = {
|
||||||
{ "debug", no_argument, NULL, 'd' },
|
{ "debug", no_argument, NULL, 'd' },
|
||||||
@ -762,12 +768,13 @@ int main(int argc, char *argv[]) {
|
|||||||
{ "unbuffered", no_argument, NULL, 'u' },
|
{ "unbuffered", no_argument, NULL, 'u' },
|
||||||
{ "nostart", no_argument, NULL, 'n' },
|
{ "nostart", no_argument, NULL, 'n' },
|
||||||
{ "detect", no_argument, NULL, 'c' },
|
{ "detect", no_argument, NULL, 'c' },
|
||||||
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{ "noinstall", no_argument, NULL, 'm' },
|
{ "noinstall", no_argument, NULL, 'm' },
|
||||||
{ NULL, 0, NULL, 0 },
|
{ NULL, 0, NULL, 0 },
|
||||||
};
|
};
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
while ((ch = getopt_long(argc, argv, "mcdvuni:b:a:t:g:x:", longopts, NULL)) != -1)
|
while ((ch = getopt_long(argc, argv, "Vmcdvuni:b:a:t:g:x:", longopts, NULL)) != -1)
|
||||||
{
|
{
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'm':
|
case 'm':
|
||||||
@ -801,6 +808,9 @@ int main(int argc, char *argv[]) {
|
|||||||
case 'c':
|
case 'c':
|
||||||
detect_only = true;
|
detect_only = true;
|
||||||
break;
|
break;
|
||||||
|
case 'V':
|
||||||
|
show_version();
|
||||||
|
return 1;
|
||||||
default:
|
default:
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user