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