summaryrefslogtreecommitdiff
path: root/src/grp-utils/systemd-path
diff options
context:
space:
mode:
Diffstat (limited to 'src/grp-utils/systemd-path')
-rw-r--r--src/grp-utils/systemd-path/Makefile6
l---------src/grp-utils/systemd-path/_sd-common.h1
-rw-r--r--src/grp-utils/systemd-path/sd-path.h2
-rw-r--r--src/grp-utils/systemd-path/systemd-path.completion.zsh18
4 files changed, 25 insertions, 2 deletions
diff --git a/src/grp-utils/systemd-path/Makefile b/src/grp-utils/systemd-path/Makefile
index 442dbf00b4..9fcae47938 100644
--- a/src/grp-utils/systemd-path/Makefile
+++ b/src/grp-utils/systemd-path/Makefile
@@ -26,9 +26,13 @@ include $(topsrcdir)/build-aux/Makefile.head.mk
bin_PROGRAMS += systemd-path
systemd_path_SOURCES = \
+ sd-path.c \
src/path/path.c
systemd_path_LDADD = \
- libshared.la
+ libbasic.la
+
+sd.CPPFLAGS += -DLIBDIR=\"$(libdir)\"
+sd.CPPFLAGS += -DROOTLIBDIR=\"$(rootlibdir)\"
include $(topsrcdir)/build-aux/Makefile.tail.mk
diff --git a/src/grp-utils/systemd-path/_sd-common.h b/src/grp-utils/systemd-path/_sd-common.h
new file mode 120000
index 0000000000..d2b5d6f4e4
--- /dev/null
+++ b/src/grp-utils/systemd-path/_sd-common.h
@@ -0,0 +1 @@
+../../libsystemd/include/systemd/_sd-common.h \ No newline at end of file
diff --git a/src/grp-utils/systemd-path/sd-path.h b/src/grp-utils/systemd-path/sd-path.h
index cac5ce761d..be6abdcd03 100644
--- a/src/grp-utils/systemd-path/sd-path.h
+++ b/src/grp-utils/systemd-path/sd-path.h
@@ -22,7 +22,7 @@
#include <inttypes.h>
-#include <systemd/_sd-common.h>
+#include "_sd-common.h"
_SD_BEGIN_DECLARATIONS;
diff --git a/src/grp-utils/systemd-path/systemd-path.completion.zsh b/src/grp-utils/systemd-path/systemd-path.completion.zsh
new file mode 100644
index 0000000000..4919cf4250
--- /dev/null
+++ b/src/grp-utils/systemd-path/systemd-path.completion.zsh
@@ -0,0 +1,18 @@
+#compdef systemd-path
+
+__get_names() {
+ systemd-path | { while IFS=: read -r a b; do echo " $a"; done; }
+}
+
+__names() {
+ local -a _names
+ _names=(${(fo)"$(__get_names)"})
+ typeset -U _names
+ _describe 'names' _names
+}
+
+_arguments \
+ {-h,--help}'[Show help message]' \
+ '--version[Show package version]' \
+ '--host=[Sufix to append to paths]:suffix' \
+ '*:name:__names'