Implementing --help as alias for -h and --version as alias for -v

This commit is contained in:
Matthias Koefferlein 2026-02-28 09:54:41 +01:00
parent f3b7146034
commit ca1d648917
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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 <file name> 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 <name>=<value> 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> Package installation: install package(s) and exit - can be used more than once")) + "\n";