From f3b71460341eb6e7c266bf193599e0c0e77f292f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 28 Feb 2026 09:48:54 +0100 Subject: [PATCH 1/2] Added documentation to clarify constraints on the documentation parameter name --- src/lay/lay/gsiDeclLayApplication.cc | 5 ++++- src/laybasic/laybasic/gsiDeclLayDispatcher.cc | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lay/lay/gsiDeclLayApplication.cc b/src/lay/lay/gsiDeclLayApplication.cc index dde5d8aac..f5ca372d3 100644 --- a/src/lay/lay/gsiDeclLayApplication.cc +++ b/src/lay/lay/gsiDeclLayApplication.cc @@ -141,13 +141,16 @@ static gsi::Methods application_methods () "@param name The name of the configuration parameter to set\n" "@param value The value to which to set the configuration parameter\n" "\n" + "The configuration parameter name needs to be a valid XML element name. Otherwise, a corrupt " + "configuration file will be produced.\n" + "\n" "This method sets the configuration parameter with the given name to the given value. " "Values can only be strings. Numerical values have to be converted into strings first. " "The actual format of the value depends on the configuration parameter. The name must " "be one of the names returned by \\get_config_names." "\n" "It is possible to write an arbitrary name/value pair into the configuration database which then is " - "written to the configuration file." + "written to the configuration file.\n" ) + // TODO: basically this method belongs to Dispatcher (aka MainWindow). // There is separate declaration for Dispatcher which we have to synchronize diff --git a/src/laybasic/laybasic/gsiDeclLayDispatcher.cc b/src/laybasic/laybasic/gsiDeclLayDispatcher.cc index e5ae50228..b005437a3 100644 --- a/src/laybasic/laybasic/gsiDeclLayDispatcher.cc +++ b/src/laybasic/laybasic/gsiDeclLayDispatcher.cc @@ -101,6 +101,9 @@ Class decl_Dispatcher ("lay", "Dispatcher", "@param name The name of the configuration parameter to set\n" "@param value The value to which to set the configuration parameter\n" "\n" + "The configuration parameter name needs to be a valid XML element name. Otherwise, a corrupt " + "configuration file will be produced.\n" + "\n" "This method sets a configuration parameter with the given name to the given value. " "Values can only be strings. Numerical values have to be converted into strings first. " "Local configuration parameters override global configurations for this specific view. " From ca1d648917f5b9623f919062ff4d632bc03f35b4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 28 Feb 2026 09:54:41 +0100 Subject: [PATCH 2/2] Implementing --help as alias for -h and --version as alias for -v --- src/klayout_main/klayout_main/klayout.cc | 4 ++-- src/lay/lay/layApplication.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/klayout_main/klayout_main/klayout.cc b/src/klayout_main/klayout_main/klayout.cc index 11d4aea39..4e04a5e10 100644 --- a/src/klayout_main/klayout_main/klayout.cc +++ b/src/klayout_main/klayout_main/klayout.cc @@ -305,12 +305,12 @@ klayout_main (int &argc, char **argv) for (int i = 1; i < argc; ++i) { - if (argv [i] == std::string ("-v")) { + if (argv [i] == std::string ("-v") || argv [i] == std::string ("--version")) { tl::info << lay::ApplicationBase::version (); return 0; - } else if (argv [i] == std::string ("-h")) { + } else if (argv [i] == std::string ("-h") || argv [i] == std::string ("--help")) { tl::info << lay::ApplicationBase::usage () << tl::noendl; return 0; diff --git a/src/lay/lay/layApplication.cc b/src/lay/lay/layApplication.cc index 139740bb0..5fb4ba47d 100644 --- a/src/lay/lay/layApplication.cc +++ b/src/lay/lay/layApplication.cc @@ -1091,7 +1091,7 @@ ApplicationBase::usage () r += tl::to_string (QObject::tr (" -t Don't update the configuration file on exit")) + "\n"; r += tl::to_string (QObject::tr (" -nt Update the configuration file on exit (default, overrides previous -t option)")) + "\n"; r += tl::to_string (QObject::tr (" -u Restore session from given file")) + "\n"; - r += tl::to_string (QObject::tr (" -v Print program version and exit")) + "\n"; + r += tl::to_string (QObject::tr (" -v Print program version and exit (also available as --version)")) + "\n"; r += tl::to_string (QObject::tr (" -wd = Define a variable within expressions")) + "\n"; r += tl::to_string (QObject::tr (" -x Synchronous drawing mode")) + "\n"; r += tl::to_string (QObject::tr (" -y Package installation: install package(s) and exit - can be used more than once")) + "\n";