From 705c944c0e2a50150ffb41707b6b3daebb45cf79 Mon Sep 17 00:00:00 2001 From: Anthony Newnam Date: Mon, 22 Feb 2010 08:36:49 -0600 Subject: Add -l option to `adb sync` Change-Id: I87c01663dff319dde24b70560e6fe5647ebf9d49 --- adb/commandline.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'adb/commandline.c') diff --git a/adb/commandline.c b/adb/commandline.c index 8781081..3ee54c7 100644 --- a/adb/commandline.c +++ b/adb/commandline.c @@ -112,6 +112,7 @@ void help() " adb push - copy file/dir to device\n" " adb pull [] - copy file/dir from device\n" " adb sync [ ] - copy host->device only if changed\n" + " (-l means list but don't copy)\n" " (see 'adb help all')\n" " adb shell - run remote shell interactively\n" " adb shell - run remote shell command\n" @@ -1041,10 +1042,19 @@ top: if(!strcmp(argv[0], "sync")) { char *srcarg, *android_srcpath, *data_srcpath; + int listonly = 0; + int ret; if(argc < 2) { /* No local path was specified. */ srcarg = NULL; + } else if (argc >= 2 && strcmp(argv[1], "-l") == 0) { + listonly = 1; + if (argc == 3) { + srcarg = argv[2]; + } else { + srcarg = NULL; + } } else if(argc == 2) { /* A local path or "android"/"data" arg was specified. */ srcarg = argv[1]; @@ -1055,9 +1065,9 @@ top: if(ret != 0) return usage(); if(android_srcpath != NULL) - ret = do_sync_sync(android_srcpath, "/system"); + ret = do_sync_sync(android_srcpath, "/system", listonly); if(ret == 0 && data_srcpath != NULL) - ret = do_sync_sync(data_srcpath, "/data"); + ret = do_sync_sync(data_srcpath, "/data", listonly); free(android_srcpath); free(data_srcpath); -- cgit v1.1