Rename --display to --display-id

The option is named "display id" everywhere.

This will be consistent with --camera-id (there will be many camera
options, so an option --camera would be confusing).

PR #4213 <https://github.com/Genymobile/scrcpy/pull/4213>
camera.36
Romain Vimont 8 months ago
parent 3432029a3d
commit 23e116064d

@ -13,7 +13,7 @@ _scrcpy() {
--crop= --crop=
-d --select-usb -d --select-usb
--disable-screensaver --disable-screensaver
--display= --display-id=
--display-buffer= --display-buffer=
-e --select-tcpip -e --select-tcpip
-f --fullscreen -f --fullscreen
@ -140,7 +140,7 @@ _scrcpy() {
|--audio-encoder \ |--audio-encoder \
|--audio-output-buffer \ |--audio-output-buffer \
|--crop \ |--crop \
|--display \ |--display-id \
|--display-buffer \ |--display-buffer \
|--max-fps \ |--max-fps \
|-m|--max-size \ |-m|--max-size \

@ -20,7 +20,7 @@ arguments=(
'--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]' '--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]'
{-d,--select-usb}'[Use USB device]' {-d,--select-usb}'[Use USB device]'
'--disable-screensaver[Disable screensaver while scrcpy is running]' '--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]' '--display-buffer=[Add a buffering delay \(in milliseconds\) before displaying]'
{-e,--select-tcpip}'[Use TCP/IP device]' {-e,--select-tcpip}'[Use TCP/IP device]'
{-f,--fullscreen}'[Start in fullscreen]' {-f,--fullscreen}'[Start in fullscreen]'

@ -94,7 +94,7 @@ Also see \fB\-e\fR (\fB\-\-select\-tcpip\fR).
Disable screensaver while scrcpy is running. Disable screensaver while scrcpy is running.
.TP .TP
.BI "\-\-display " id .BI "\-\-display\-id " id
Specify the device display id to mirror. Specify the device display id to mirror.
The available display ids can be listed by \-\-list\-displays. The available display ids can be listed by \-\-list\-displays.

@ -32,6 +32,7 @@ enum {
OPT_WINDOW_BORDERLESS, OPT_WINDOW_BORDERLESS,
OPT_MAX_FPS, OPT_MAX_FPS,
OPT_LOCK_VIDEO_ORIENTATION, OPT_LOCK_VIDEO_ORIENTATION,
OPT_DISPLAY,
OPT_DISPLAY_ID, OPT_DISPLAY_ID,
OPT_ROTATION, OPT_ROTATION,
OPT_RENDER_DRIVER, OPT_RENDER_DRIVER,
@ -232,9 +233,15 @@ static const struct sc_option options[] = {
.text = "Disable screensaver while scrcpy is running.", .text = "Disable screensaver while scrcpy is running.",
}, },
{ {
.longopt_id = OPT_DISPLAY_ID, // deprecated
.longopt_id = OPT_DISPLAY,
.longopt = "display", .longopt = "display",
.argdesc = "id", .argdesc = "id",
},
{
.longopt_id = OPT_DISPLAY_ID,
.longopt = "display-id",
.argdesc = "id",
.text = "Specify the device display id to mirror.\n" .text = "Specify the device display id to mirror.\n"
"The available display ids can be listed by:\n" "The available display ids can be listed by:\n"
" scrcpy --list-displays\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: case OPT_CROP:
opts->crop = optarg; opts->crop = optarg;
break; break;
case OPT_DISPLAY:
LOGW("--display is deprecated, use --display-id instead.");
// fall through
case OPT_DISPLAY_ID: case OPT_DISPLAY_ID:
if (!parse_display_id(optarg, &opts->display_id)) { if (!parse_display_id(optarg, &opts->display_id)) {
return false; return false;

@ -143,7 +143,7 @@ If several displays are available on the Android device, it is possible to
select the display to mirror: select the display to mirror:
```bash ```bash
scrcpy --display=1 scrcpy --display-id=1
``` ```
The list of display ids can be retrieved by: The list of display ids can be retrieved by:

@ -47,7 +47,7 @@ public final class LogUtils {
builder.append("\n (none)"); builder.append("\n (none)");
} else { } else {
for (int id : displayIds) { for (int id : displayIds) {
builder.append("\n --display=").append(id).append(" ("); builder.append("\n --display-id=").append(id).append(" (");
DisplayInfo displayInfo = displayManager.getDisplayInfo(id); DisplayInfo displayInfo = displayManager.getDisplayInfo(id);
if (displayInfo != null) { if (displayInfo != null) {
Size size = displayInfo.getSize(); Size size = displayInfo.getSize();

Loading…
Cancel
Save