File: Added-version-to-programs.patch

package info (click to toggle)
aiocoap 0.4.17-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,040 kB
  • sloc: python: 17,241; makefile: 23; sh: 9
file content (23 lines) | stat: -rw-r--r-- 823 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: Added version to programs
 This patch adds a command line option --version that outputs a version string
 that is usable by help2man tool.
Author: Mazen Neifer <mazen@debian.org>
Origin: Debian
Bug: https://github.com/chrysn/aiocoap/issues/374
Forwarded: yes
Last-Update: 2025-04-03

Index: aiocoap/aiocoap/cli/proxy.py
===================================================================
--- aiocoap.orig/aiocoap/cli/proxy.py
+++ aiocoap/aiocoap/cli/proxy.py
@@ -22,6 +22,9 @@ from aiocoap.cli.common import add_serve
 
 def build_parser():
     p = argparse.ArgumentParser(description=__doc__)
+    p.add_argument(
+        "--version", action="version", version="%(prog)s " + aiocoap.meta.version
+    )
 
     mode = p.add_argument_group(
         "mode", "Required argument for setting the operation mode"