From ca1d648917f5b9623f919062ff4d632bc03f35b4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 28 Feb 2026 09:54:41 +0100 Subject: [PATCH] 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";