new: implement --version option

This commit is contained in:
ngn
2024-08-15 04:34:14 +03:00
parent 22364da8be
commit d0013946f4
3 changed files with 40 additions and 19 deletions

View File

@ -108,14 +108,20 @@ END:
}
int main(int argc, char **argv, char **envp) {
signal(SIGINT, SIG_IGN);
setlocale(LC_ALL, "");
textdomain("xcfg");
if (getuid() == 0) {
error(_("You should use this script as a regular user, not as root!"));
return EXIT_FAILURE;
}
signal(SIGINT, SIG_IGN);
setlocale(LC_ALL, "");
textdomain("xcfg");
if (argc >= 2 && strcmp(argv[1], "--version") == 0) {
success(_("Simple xorg configuration tool %s"), VERSION);
info(_("Licensed under GPLv3, see https://www.gnu.org/licenses/ for more information"));
return EXIT_SUCCESS;
}
struct Desktop desktops[] = {
{