Skip to content

Commit 63122ba

Browse files
committed
Use program version from git tag
This should fix issue #51.
1 parent 047bb1e commit 63122ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ RM := rm -rf
1414
CC ?= gcc
1515
CFLAGS ?= -g -O0
1616
CFLAGS += -Wall -Wextra -std=c99 -pedantic
17+
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
18+
CFLAGS += -DPROGRAM_VERSION=\"$(GIT_VERSION)\"
1719

1820
ifeq ($(UNAME_S),Linux)
1921
LDFLAGS += -Wl,-z,relro -lusb-1.0

uhubctl.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*
1010
*/
1111

12-
#define PROGRAM_VERSION "1.8"
1312
#define _XOPEN_SOURCE 500
1413

1514
#include <stdio.h>
@@ -181,7 +180,7 @@ static const struct option long_options[] = {
181180
int print_usage()
182181
{
183182
printf(
184-
"uhubctl v%s: utility to control USB port power for smart hubs.\n"
183+
"uhubctl %s: utility to control USB port power for smart hubs.\n"
185184
"Usage: uhubctl [options]\n"
186185
"Without options, show status for all smart hubs.\n"
187186
"\n"

0 commit comments

Comments
 (0)