|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2012 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a function to generate an application info. |
|
8 """ |
|
9 |
|
10 from UI.Info import Version |
|
11 |
|
12 |
|
13 def makeAppInfo(argv, name, arg, description, options=None): |
|
14 """ |
|
15 Module function to generate a dictionary describing the application. |
|
16 |
|
17 @param argv list of commandline parameters (list of strings) |
|
18 @param name name of the application (string) |
|
19 @param arg commandline arguments (string) |
|
20 @param description text describing the application (string) |
|
21 @param options list of additional commandline options |
|
22 (list of tuples of two strings (commandline option, |
|
23 option description)). The options --version, --help and -h are |
|
24 always present and must not be repeated in this list. |
|
25 @return dictionary describing the application |
|
26 """ |
|
27 return { |
|
28 "bin": argv[0], |
|
29 "arg": arg, |
|
30 "name": name, |
|
31 "description": description, |
|
32 "version": Version, |
|
33 "options": [] if options is None else options[:] |
|
34 } |