version 1.190, 2019/10/14 08:38:07 |
version 1.191, 2020/01/28 10:44:30 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <sys/utsname.h> |
|
|
#include <err.h> |
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
|
|
return (home); |
return (home); |
} |
} |
|
|
|
const char * |
|
getversion(void) |
|
{ |
|
static char *version; |
|
struct utsname u; |
|
|
|
if (version == NULL) { |
|
if (uname(&u) < 0) |
|
fatalx("uname failed"); |
|
xasprintf(&version, "openbsd-%s", u.release); |
|
} |
|
return version; |
|
} |
|
|
int |
int |
main(int argc, char **argv) |
main(int argc, char **argv) |
{ |
{ |
|
|
flags = 0; |
flags = 0; |
|
|
label = path = NULL; |
label = path = NULL; |
while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUv")) != -1) { |
while ((opt = getopt(argc, argv, "2c:Cdf:lL:qS:uUvV")) != -1) { |
switch (opt) { |
switch (opt) { |
case '2': |
case '2': |
flags |= CLIENT_256COLOURS; |
flags |= CLIENT_256COLOURS; |
|
|
case 'f': |
case 'f': |
set_cfg_file(optarg); |
set_cfg_file(optarg); |
break; |
break; |
|
case 'V': |
|
printf("%s %s\n", getprogname(), getversion()); |
|
exit(0); |
case 'l': |
case 'l': |
flags |= CLIENT_LOGIN; |
flags |= CLIENT_LOGIN; |
break; |
break; |