summaryrefslogtreecommitdiffstats
path: root/linux/Platform.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-03-22 14:49:07 +1100
committerNathan Scott <nathans@redhat.com>2021-03-22 17:16:40 +1100
commit253ff23f9e3a26c9575758fd1849b457c5d4d635 (patch)
treeb756365fd3c197fc568b9ff68653bda0d2b0e0f3 /linux/Platform.h
parentd56d23d91adf3fad512e5311fcdd0ca129e820c7 (diff)
Use a platform-specific routine for long option usage
Related to https://github.com/htop-dev/htop/pull/564
Diffstat (limited to 'linux/Platform.h')
-rw-r--r--linux/Platform.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/linux/Platform.h b/linux/Platform.h
index 30544997..18d303d1 100644
--- a/linux/Platform.h
+++ b/linux/Platform.h
@@ -27,19 +27,6 @@ in the source distribution for its full text.
#define PATH_MAX 4096
#endif
-#ifdef HAVE_LIBCAP
- #define PLATFORM_LONG_OPTIONS \
- {"drop-capabilities", optional_argument, 0, 128},
- #define PLATFORM_LONG_OPTIONS_USAGE \
- " --drop-capabilities[=none|basic|strict] Drop Linux capabilities when running as root\n" \
- " none - do not drop any capabilities\n" \
- " basic (default) - drop all capabilities not needed by htop\n" \
- " strict - drop all capabilities except those needed for core functionality\n"
-#else
- #define PLATFORM_LONG_OPTIONS
- #define PLATFORM_LONG_OPTIONS_USAGE
-#endif
-
extern const ProcessField Platform_defaultFields[];
@@ -95,6 +82,15 @@ static inline void Platform_getRelease(char** string) {
*string = Generic_uname();
}
+#ifdef HAVE_LIBCAP
+ #define PLATFORM_LONG_OPTIONS \
+ {"drop-capabilities", optional_argument, 0, 128},
+#else
+ #define PLATFORM_LONG_OPTIONS
+#endif
+
+void Platform_longOptionsUsage(const char* name);
+
bool Platform_getLongOption(int opt, int argc, char** argv);
#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy