aboutsummaryrefslogtreecommitdiff
path: root/doc/man/gnunet-search.1
diff options
context:
space:
mode:
authormadmurphy <madmurphy333@gmail.com>2022-02-12 18:14:33 +0000
committermadmurphy <madmurphy333@gmail.com>2022-02-12 18:14:33 +0000
commit8c316d9dc98c66bcf5ff12a82528d7d195743885 (patch)
treef7be2ad47b70cd284642b43e5627e33f5c89dd64 /doc/man/gnunet-search.1
parentc252554c5abd40376059a72110b49c5c5d2ca691 (diff)
downloadgnunet-8c316d9dc98c66bcf5ff12a82528d7d195743885.tar.gz
gnunet-8c316d9dc98c66bcf5ff12a82528d7d195743885.zip
`man gnunet-search`: add `--printf` examples, update page date
Diffstat (limited to 'doc/man/gnunet-search.1')
-rw-r--r--doc/man/gnunet-search.151
1 files changed, 50 insertions, 1 deletions
diff --git a/doc/man/gnunet-search.1 b/doc/man/gnunet-search.1
index 7209205f6..c36f5d060 100644
--- a/doc/man/gnunet-search.1
+++ b/doc/man/gnunet-search.1
@@ -21,7 +21,7 @@
21.\" 21.\"
22.\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later 22.\" SPDX-License-Identifier: GPL3.0-or-later OR FDL1.3-or-later
23.\" 23.\"
24.Dd February 25, 2012 24.Dd February 12, 2022
25.Dt GNUNET-SEARCH 1 25.Dt GNUNET-SEARCH 1
26.Os 26.Os
27.Sh NAME 27.Sh NAME
@@ -347,6 +347,55 @@ The metadata here is the description
347See the options for 347See the options for
348.Xr gnunet-publish 1 348.Xr gnunet-publish 1
349on how to supply metadata by hand. 349on how to supply metadata by hand.
350.Pp
351The
352.Fl -printf
353.No ( Ns
354.Fl f Ns
355),
356.Fl -dir-printf
357.No ( Ns
358.Fl F Ns
359) and
360.Fl -iter-printf
361.No ( Ns
362.Fl i Ns
363) arguments offer powerful tools for manipulating the output printed. For instance,
364.Pp
365Example 4:
366.Pp
367.ad l
368 $ gnunet-search -f '%f (%s bytes)\en' commons
369.Pp
370will print a simple list of the results that match the
371.Dq commons
372keyword, with only the file name and the size printed, without any URI. Or, for instance,
373.Pp
374Example 5:
375.Pp
376.ad l
377 #!/bin/sh
378 {
379 printf '<list>'
380 gnunet-search -f '\en\et<file uri="%u">
381 \et\et<filename len="%l">%f</filename>
382 \et\et<size>%s</size>\en\et\et<mimetype>%m</mimetype>
383 \et\et<result_id>%n</result_id>
384 \et\et<metadata>%a\en\et\et</metadata>\en\et</file>' \e
385 -i '\en\et\et<property tid="%i" type="%t">
386 \et\et\et<content len="%l">%p</content>
387 \et\et\et<property_id>%n</property_id>
388 \et\et\et<provided_by>%w</provided_by>
389 \et\et</file>' \e
390 -t '2 s' commons
391 printf '\en</list>\en'
392 } > commons.xml
393.Pp
394will run for two seconds and then create a file named
395.Pa commons.xml Ns
396, containing the search results that match the
397.Dq commons
398keyword in XML format.
350.Sh SEE ALSO 399.Sh SEE ALSO
351.Xr gnunet-download 1 , 400.Xr gnunet-download 1 ,
352.Xr gnunet-fs-gtk 1 , 401.Xr gnunet-fs-gtk 1 ,