mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
main/client: simplify code for printing --version string
This commit is contained in:
parent
d48a1c53f5
commit
eb9357709b
5 changed files with 42 additions and 68 deletions
17
client.c
17
client.c
|
|
@ -22,7 +22,6 @@
|
|||
#include "foot-features.h"
|
||||
#include "macros.h"
|
||||
#include "util.h"
|
||||
#include "version.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
extern char **environ;
|
||||
|
|
@ -62,20 +61,6 @@ sendall(int sock, const void *_buf, size_t len)
|
|||
return len;
|
||||
}
|
||||
|
||||
static const char *
|
||||
version_and_features(void)
|
||||
{
|
||||
static char buf[256];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"version: %s %cpgo %cime %cgraphemes %cassertions",
|
||||
FOOT_VERSION,
|
||||
feature_pgo() ? '+' : '-',
|
||||
feature_ime() ? '+' : '-',
|
||||
feature_graphemes() ? '+' : '-',
|
||||
feature_assertions() ? '+' : '-');
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
print_usage(const char *prog_name)
|
||||
{
|
||||
|
|
@ -328,7 +313,7 @@ main(int argc, char *const *argv)
|
|||
break;
|
||||
|
||||
case 'v':
|
||||
printf("footclient %s\n", version_and_features());
|
||||
print_version_and_features("footclient ");
|
||||
ret = EXIT_SUCCESS;
|
||||
goto err;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue