yad icon indicating copy to clipboard operation
yad copied to clipboard

Could not make --rest option to work

Open sergei-mironov opened this issue 1 year ago • 3 comments

Hi. Despite all my efforts, I can not make yad to read additional arguments from a file.

Here is what I do:

(
echo "--title"  # also tried "title" without dashes, did not help
echo "My title"
) >_args
yad  --rest=_args

My expectation: yad shows a window titled with "My title" string. But yad shows the default window instead. Could you please help?

$ yad --version
12.0 (GTK+ 3.24.35)

sergei-mironov avatar Feb 03 '24 08:02 sergei-mironov

--rest is for extra command line arguments such as list or form data. not for options

if you wish to use a kind of external entity for some options - there is YAD_OPTIONS environment variable

v1cont avatar Feb 07 '24 17:02 v1cont

@v1cont what format would this file be in? Not finding any examples anywhere.

joeskeen avatar Jun 10 '25 18:06 joeskeen

@joeskeen, the --rest file is formatted as text -- lines terminated by the new line sequence. With --rest=FILE yad fills all expected but missing positional arguments by reading the next line of FILE. So if you

cat << EOF > /tmp/restfile
hello there

third line
EOF

Then run

yad --form --field=L1 --field=L2 --field=L3 --rest=/tmp/restfile

yad will display a form with three text entry fields labeled L1, L2 and L3. L1 will default to "hello world", L2 to "", and L3 to third line".

step- avatar Jun 10 '25 18:06 step-