diff --git a/app/data/bash-completion/scrcpy b/app/data/bash-completion/scrcpy index a44ff6e5..fe118289 100644 --- a/app/data/bash-completion/scrcpy +++ b/app/data/bash-completion/scrcpy @@ -13,7 +13,7 @@ _scrcpy() { --crop= -d --select-usb --disable-screensaver - --display= + --display-id= --display-buffer= -e --select-tcpip -f --fullscreen @@ -140,7 +140,7 @@ _scrcpy() { |--audio-encoder \ |--audio-output-buffer \ |--crop \ - |--display \ + |--display-id \ |--display-buffer \ |--max-fps \ |-m|--max-size \ diff --git a/app/data/zsh-completion/_scrcpy b/app/data/zsh-completion/_scrcpy index ac40e903..b688c0aa 100644 --- a/app/data/zsh-completion/_scrcpy +++ b/app/data/zsh-completion/_scrcpy @@ -20,7 +20,7 @@ arguments=( '--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]' {-d,--select-usb}'[Use USB device]' '--disable-screensaver[Disable screensaver while scrcpy is running]' - '--display=[Specify the display id to mirror]' + '--display-id=[Specify the display id to mirror]' '--display-buffer=[Add a buffering delay \(in milliseconds\) before displaying]' {-e,--select-tcpip}'[Use TCP/IP device]' {-f,--fullscreen}'[Start in fullscreen]' diff --git a/app/scrcpy.1 b/app/scrcpy.1 index 7ae56a27..80613aed 100644 --- a/app/scrcpy.1 +++ b/app/scrcpy.1 @@ -94,7 +94,7 @@ Also see \fB\-e\fR (\fB\-\-select\-tcpip\fR). Disable screensaver while scrcpy is running. .TP -.BI "\-\-display " id +.BI "\-\-display\-id " id Specify the device display id to mirror. The available display ids can be listed by \-\-list\-displays. diff --git a/app/src/cli.c b/app/src/cli.c index bc1aa2b5..2ae0ced2 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -32,6 +32,7 @@ enum { OPT_WINDOW_BORDERLESS, OPT_MAX_FPS, OPT_LOCK_VIDEO_ORIENTATION, + OPT_DISPLAY, OPT_DISPLAY_ID, OPT_ROTATION, OPT_RENDER_DRIVER, @@ -232,9 +233,15 @@ static const struct sc_option options[] = { .text = "Disable screensaver while scrcpy is running.", }, { - .longopt_id = OPT_DISPLAY_ID, + // deprecated + .longopt_id = OPT_DISPLAY, .longopt = "display", .argdesc = "id", + }, + { + .longopt_id = OPT_DISPLAY_ID, + .longopt = "display-id", + .argdesc = "id", .text = "Specify the device display id to mirror.\n" "The available display ids can be listed by:\n" " scrcpy --list-displays\n" @@ -1702,6 +1709,9 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[], case OPT_CROP: opts->crop = optarg; break; + case OPT_DISPLAY: + LOGW("--display is deprecated, use --display-id instead."); + // fall through case OPT_DISPLAY_ID: if (!parse_display_id(optarg, &opts->display_id)) { return false; diff --git a/doc/video.md b/doc/video.md index 57af5c9f..5ce749f9 100644 --- a/doc/video.md +++ b/doc/video.md @@ -143,7 +143,7 @@ If several displays are available on the Android device, it is possible to select the display to mirror: ```bash -scrcpy --display=1 +scrcpy --display-id=1 ``` The list of display ids can be retrieved by: diff --git a/server/src/main/java/com/genymobile/scrcpy/LogUtils.java b/server/src/main/java/com/genymobile/scrcpy/LogUtils.java index 243a156b..ce1617e4 100644 --- a/server/src/main/java/com/genymobile/scrcpy/LogUtils.java +++ b/server/src/main/java/com/genymobile/scrcpy/LogUtils.java @@ -47,7 +47,7 @@ public final class LogUtils { builder.append("\n (none)"); } else { for (int id : displayIds) { - builder.append("\n --display=").append(id).append(" ("); + builder.append("\n --display-id=").append(id).append(" ("); DisplayInfo displayInfo = displayManager.getDisplayInfo(id); if (displayInfo != null) { Size size = displayInfo.getSize();