diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-03-22 15:42:45 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-03-22 17:29:12 +0100 |
| commit | c70a45eb935dc536ce59ec860c17b4c1c531a663 (patch) | |
| tree | 22afac8b77fefc6e5878b5605e1c878e0edd3345 /genconfig.py | |
| parent | e4a71defef40b6ab640dedaf185562f343f963c9 (diff) | |
Convert some comments to module docstrings in utilities
This makes running pydoc(3) on the utilities helpful.
Reuse the module docstring for the --help text for utilities that use
argparse.
Also fix some copy-paste errors in the all*config.py descriptions and
clean up the language a bit.
Piggyback removal of an optimization in allmodconfig.py that's pretty
irrelevant now.
Diffstat (limited to 'genconfig.py')
| -rwxr-xr-x | genconfig.py | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/genconfig.py b/genconfig.py index f83fd4c..23ba4b8 100755 --- a/genconfig.py +++ b/genconfig.py @@ -3,18 +3,17 @@ # Copyright (c) 2018-2019, Ulf Magnusson # SPDX-License-Identifier: ISC -# Generates a C header from the configuration, matching the format of -# include/generated/autoconf.h in the kernel. -# -# Optionally generates a directory structure with one file per symbol that can -# be used to implement incremental builds. See the docstring for -# Kconfig.sync_deps() in Kconfiglib. -# -# Usage (see argument help texts for more information): -# -# genconfig.py [-h] [--header-path HEADER_FILE] -# [--sync-deps [OUTPUT_DIR]] [--config-out CONFIG_FILE] -# [KCONFIG_FILENAME] +""" +Generates a header file with #defines from the configuration, matching the +format of include/generated/autoconf.h in the Linux kernel. + +Optionally creates/updates a directory structure with one file per symbol that +can be used to implement incremental builds. See the docstring for +Kconfig.sync_deps() in kconfiglib.py. + +By default, the configuration is generated from '.config'. A different +configuration file can be passed in the KCONFIG_CONFIG environment variable. +""" import argparse @@ -26,12 +25,9 @@ DEFAULT_SYNC_DEPS_PATH = "deps/" def main(): - parser = argparse.ArgumentParser(description=""" -Generates a header file with defines from the configuration. Optionally -creates/updates a directory with incremental build information as well (see the -docstring for the Kconfig.sync_deps() function in Kconfiglib). The .config file -to generate the configuration from can be specified by setting the -KCONFIG_CONFIG environment variable.""") + parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, + description=__doc__) parser.add_argument( "--header-path", |
