Daniele Bartolini 9 년 전
부모
커밋
acb6dfb20e
1개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 11 3
      src/device/device_options.cpp

+ 11 - 3
src/device/device_options.cpp

@@ -77,6 +77,7 @@ int DeviceOptions::parse()
 		return EXIT_FAILURE;
 	}
 
+	_source_dir = cl.get_parameter("source-dir");
 	_bundle_dir = cl.get_parameter("bundle-dir");
 
 	_do_compile = cl.has_argument("compile");
@@ -98,14 +99,12 @@ int DeviceOptions::parse()
 			return EXIT_FAILURE;
 		}
 
-		_source_dir = cl.get_parameter("source-dir");
 		if (_source_dir == NULL)
 		{
 			help("Source dir must be specified.");
 			return EXIT_FAILURE;
 		}
 
-		_bundle_dir = cl.get_parameter("bundle-dir");
 		if (_bundle_dir == NULL)
 		{
 			help("Bundle dir must be specified.");
@@ -113,6 +112,16 @@ int DeviceOptions::parse()
 		}
 	}
 
+	_server = cl.has_argument("server");
+	if (_server)
+	{
+		if (_source_dir == NULL)
+		{
+			help("Source dir must be specified.");
+			return EXIT_FAILURE;
+		}
+	}
+
 	if (_bundle_dir != NULL)
 	{
 		if (!path::is_absolute(_bundle_dir))
@@ -132,7 +141,6 @@ int DeviceOptions::parse()
 	}
 
 	_do_continue = cl.has_argument("continue");
-	_server = cl.has_argument("server");
 
 	_boot_dir = cl.get_parameter("boot-dir");
 	if (_boot_dir != NULL)