options: rename --screenshot-directory to --screenshot-dir

Less characters is better? Other options use -dir for directory so
consistency I guess.
This commit is contained in:
Dudemanguy 2023-10-15 10:56:12 -05:00
parent b626f3ba83
commit 1370ecfc1b
6 changed files with 7 additions and 5 deletions

View File

@ -104,6 +104,7 @@ Interface changes
- rename `--fps` to `--container-fps-override` - rename `--fps` to `--container-fps-override`
- rename `--override-display-fps` to `--display-fps-override` - rename `--override-display-fps` to `--display-fps-override`
- rename `--sub-ass-force-style` to `--sub-ass-style-overrides` - rename `--sub-ass-force-style` to `--sub-ass-style-overrides`
- rename `--screenshot-directory` to `--screenshot-dir`
--- mpv 0.36.0 --- --- mpv 0.36.0 ---
- add `--target-contrast` - add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used. - Target luminance value is now also applied when ICC profile is used.

View File

@ -4451,7 +4451,7 @@ Screenshot
``%%`` ``%%``
Replaced with the ``%`` character itself. Replaced with the ``%`` character itself.
``--screenshot-directory=<path>`` ``--screenshot-dir=<path>``
Store screenshots in this directory. This path is joined with the filename Store screenshots in this directory. This path is joined with the filename
generated by ``--screenshot-template``. If the template filename is already generated by ``--screenshot-template``. If the template filename is already
absolute, the directory is ignored. absolute, the directory is ignored.

View File

@ -16,7 +16,7 @@ player-operation-mode=pseudo-gui
terminal=no terminal=no
force-window=yes force-window=yes
idle=once idle=once
screenshot-directory=~~desktop/ screenshot-dir=~~desktop/
[libmpv] [libmpv]
config=no config=no

View File

@ -815,7 +815,7 @@ static const m_option_t mp_opts[] = {
{"screenshot", OPT_SUBSTRUCT(screenshot_image_opts, screenshot_conf)}, {"screenshot", OPT_SUBSTRUCT(screenshot_image_opts, screenshot_conf)},
{"screenshot-template", OPT_STRING(screenshot_template)}, {"screenshot-template", OPT_STRING(screenshot_template)},
{"screenshot-directory", OPT_STRING(screenshot_directory), {"screenshot-dir", OPT_STRING(screenshot_dir),
.flags = M_OPT_FILE}, .flags = M_OPT_FILE},
{"screenshot-sw", OPT_BOOL(screenshot_sw)}, {"screenshot-sw", OPT_BOOL(screenshot_sw)},
@ -886,6 +886,7 @@ static const m_option_t mp_opts[] = {
{"", OPT_SUBSTRUCT(encode_opts, encode_config)}, {"", OPT_SUBSTRUCT(encode_opts, encode_config)},
{"screenshot-directory", OPT_REPLACED("screenshot-dir")},
{"sub-forced-only", OPT_REPLACED("sub-forced-events-only")}, {"sub-forced-only", OPT_REPLACED("sub-forced-events-only")},
{0} {0}
}; };

View File

@ -293,7 +293,7 @@ typedef struct MPOpts {
struct image_writer_opts *screenshot_image_opts; struct image_writer_opts *screenshot_image_opts;
char *screenshot_template; char *screenshot_template;
char *screenshot_directory; char *screenshot_dir;
bool screenshot_sw; bool screenshot_sw;
struct m_channels audio_output_channels; struct m_channels audio_output_channels;

View File

@ -295,7 +295,7 @@ static char *gen_fname(struct mp_cmd_ctx *cmd, const char *file_ext)
return NULL; return NULL;
} }
char *dir = ctx->mpctx->opts->screenshot_directory; char *dir = ctx->mpctx->opts->screenshot_dir;
if (dir && dir[0]) { if (dir && dir[0]) {
void *t = fname; void *t = fname;
dir = mp_get_user_path(t, ctx->mpctx->global, dir); dir = mp_get_user_path(t, ctx->mpctx->global, dir);