Fail on deprecated options

Suggest the video and audio specific options instead.
This commit is contained in:
Romain Vimont 2023-03-11 16:40:39 +01:00
parent 426dfbf21d
commit c22c87eded

View file

@ -1535,8 +1535,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
while ((c = getopt_long(argc, argv, optstring, longopts, NULL)) != -1) { while ((c = getopt_long(argc, argv, optstring, longopts, NULL)) != -1) {
switch (c) { switch (c) {
case OPT_BIT_RATE: case OPT_BIT_RATE:
LOGW("--bit-rate is deprecated, use --video-bit-rate instead."); LOGE("--bit-rate has been removed, "
// fall through "use --video-bit-rate or --audio-bit-rate.");
return false;
case 'b': case 'b':
if (!parse_bit_rate(optarg, &opts->video_bit_rate)) { if (!parse_bit_rate(optarg, &opts->video_bit_rate)) {
return false; return false;
@ -1709,9 +1710,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
opts->forward_key_repeat = false; opts->forward_key_repeat = false;
break; break;
case OPT_CODEC_OPTIONS: case OPT_CODEC_OPTIONS:
LOGW("--codec-options is deprecated, use --video-codec-options " LOGE("--codec-options has been removed, "
"instead."); "use --video-codec-options or --audio-codec-options.");
// fall through return false;
case OPT_VIDEO_CODEC_OPTIONS: case OPT_VIDEO_CODEC_OPTIONS:
opts->video_codec_options = optarg; opts->video_codec_options = optarg;
break; break;
@ -1719,8 +1720,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
opts->audio_codec_options = optarg; opts->audio_codec_options = optarg;
break; break;
case OPT_ENCODER: case OPT_ENCODER:
LOGW("--encoder is deprecated, use --video-encoder instead."); LOGE("--encoder has been removed, "
// fall through "use --video-encoder or --audio-encoder.");
return false;
case OPT_VIDEO_ENCODER: case OPT_VIDEO_ENCODER:
opts->video_encoder = optarg; opts->video_encoder = optarg;
break; break;
@ -1775,8 +1777,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
opts->start_fps_counter = true; opts->start_fps_counter = true;
break; break;
case OPT_CODEC: case OPT_CODEC:
LOGW("--codec is deprecated, use --video-codec instead."); LOGE("--codec has been removed, "
// fall through "use --video-codec or --audio-codec.");
return false;
case OPT_VIDEO_CODEC: case OPT_VIDEO_CODEC:
if (!parse_video_codec(optarg, &opts->video_codec)) { if (!parse_video_codec(optarg, &opts->video_codec)) {
return false; return false;