]> git.ipfire.org Git - thirdparty/zstd.git/commit
CLI: simplified handling of separated-fields arguments
authorYann Collet <cyan@fb.com>
Fri, 17 Jul 2020 19:46:36 +0000 (12:46 -0700)
committerYann Collet <cyan@fb.com>
Fri, 17 Jul 2020 19:46:36 +0000 (12:46 -0700)
commita7e5652672ab3899bf8291e653eb760f6b655f27
tree6a8cdef711fd08d29531d6fa30b746cf24d7d98b
parent40f20b6453bdc1941954125ca1d309aa152bd921
CLI: simplified handling of separated-fields arguments

this patch reduces complexity associated with
commands requiring a separated arguments
such as :
-o filename
-D dictionary
--output-dir-flat dir
--output-dir-mirror dir

It used to be a multi-stage process with explicit context,
it's now simplified as a single macro.

Thanks to this simplification,
separated arguments logic has also been extended to
--patch-from XXX
--filelist XXX
which extends existing capability using =XXX
--patch-from=XXX
--filelist=XXX

Separated argument is useful for filenames and directories,
as it benefits from shell expansion
such as ~/dir/file
where the ~ is automatically translated by the shell.
In contrast --long-command=FILE does not interpret FILE,
so ~/ is transmitted as is to the main() function,
generally resulting in incorrect file name.
programs/zstdcli.c