commit:     288b3b03f7c53777d6e08d5dec29c91cddd91d77
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 18 17:18:07 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 18 17:18:07 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=288b3b03

pquery: improve documentation of `--attr`

Resolves: https://github.com/pkgcore/pkgcore/issues/423
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcore/scripts/pquery.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/pkgcore/scripts/pquery.py b/src/pkgcore/scripts/pquery.py
index ea20c2eb..bae4ca36 100644
--- a/src/pkgcore/scripts/pquery.py
+++ b/src/pkgcore/scripts/pquery.py
@@ -1116,7 +1116,7 @@ output.add_argument(
         Print the given attribute's value. This option can be specified
         multiple times.
 
-        Valid attributes: {', '.join(printable_attrs)}
+        Valid attributes: {', '.join(f'``{x}``' for x in printable_attrs)}
     """,
 )
 output.add_argument(
@@ -1125,9 +1125,8 @@ output.add_argument(
     dest="attr",
     metavar="attribute",
     default=[],
-    help="like --attr but accepts any string as "
-    "attribute name instead of only explicitly "
-    "supported names",
+    help="""Like --attr but accepts any string as attribute name instead
+    of only explicitly supported names.""",
 )
 one_attr_mux = output.add_mutually_exclusive_group()
 one_attr_mux.add_argument(
@@ -1135,6 +1134,11 @@ one_attr_mux.add_argument(
     choices=printable_attrs,
     metavar="attribute",
     help="print one attribute, suppresses other output",
+    docs=f"""
+        Print the given attribute's value, while suppressing all other output.
+        This option can be specified multiple times. All attributes of 
``--attr``
+        are accepted.
+    """,
 )
 one_attr_mux.add_argument(
     "--force-one-attr",

Reply via email to