Description: offpunk.py: fix --features argument.
 Running offpunk --features results in the following crash:
 .
 	$ offpunk --features
 	To render images inline, you need either chafa >= 1.10 or timg > 1.3.2
 	Traceback (most recent call last):
 	  File "/usr/bin/offpunk", line 8, in <module>
 	    sys.exit(main())
 	             ~~~~^^
 	  File "/usr/lib/python3/dist-packages/offpunk.py", line 2501, in main
 	    GeminiClient.do_version(None, None)
 	    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
 	  File "/usr/lib/python3/dist-packages/offpunk.py", line 1315, in do_version
 	    output += _("ftr_site_config     : ") + str(self.options["ftr_site_config"]) + "\n"
 	                                                ^^^^^^^^^^^^
 	AttributeError: 'NoneType' object has no attribute 'options'
 .
 Interestingly, running the `version` command from the prompt (which
 achieves mostly the same thing as --features) works as intended:
 .
 	$ offpunk
 	To render images inline, you need either chafa >= 1.10 or timg > 1.3.2
 	Welcome to Offpunk!
 	Type `help` to get the list of available command.
 	ON> version
 	Offpunk 3.0
 	===========
 	System: linux
 	Python: 3.13.12 (main, Feb  4 2026, 15:06:39) [GCC 15.2.0]
 	Language: C
 .
 	Highly recommended:
 	 - xdg-open            : 	Not Installed
 .
 	Web browsing:
 	 - python-requests     : 	Not Installed
 	 - python-feedparser   : 	Not Installed
 	 - python-bs4          : 	Not Installed
 	 - python-readability  : 	Not Installed
 	 - timg 1.3.2+         : 	Not Installed
 	 - chafa 1.10+         : 	Not Installed
 .
 	Nice to have:
 	 - python-setproctitle             : 	Not Installed
 	 - python-cryptography             : 	Not Installed
 	 - X11 clipboard (xsel or xclip)   : 	Not Installed
 	 - Wayland clipboard (wl-clipboard): 	Not Installed
 .
 	Features :
 	 - Render images (chafa or timg)              : 	Not Installed
 	 - Render HTML (bs4, readability)             : 	Not Installed
 	 - Render Atom/RSS feeds (feedparser)         : 	Not Installed
 	 - Connect to http/https (requests)           : 	Not Installed
 	 - Detect text encoding (python-chardet)      : 	Not Installed
 	 - restore last position (less 572+)          : 	Installed
 .
 	ftr_site_config     : None
 	Config directory    : /home/emollier/.config/offpunk/
 	User Data directory : /home/emollier/.local/share/offpunk/
 	Cache directory      : /home/emollier/.cache/offpunk/
 .
 Instantiating a GeminiClient to give a context to the "options"
 attribute works around the issue with --features, hence the present
 patch proposal, but there may exist cleaner approaches.
Author: Étienne Mollier <emollier@debian.org>
Forwarded: https://lists.sr.ht/~lioploum/offpunk-devel/patches/67592
Last-Update: 2026-02-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- offpunk.orig/offpunk.py
+++ offpunk/offpunk.py
@@ -2498,7 +2498,8 @@
         print("Offpunk " + __version__)
         sys.exit()
     elif args.features:
-        GeminiClient.do_version(None, None)
+        gc = GeminiClient(None)
+        gc.do_version(None, None)
         sys.exit()
     else:
         for f in [xdg("config"), xdg("data")]:
