summaryrefslogtreecommitdiffstats
path: root/pcp-htop.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-03-25 17:24:14 +1100
committerNathan Scott <nathans@redhat.com>2021-06-09 17:09:29 +1000
commit5dfb5242370610dfad09c855925224c587edbfbf (patch)
treec39bdb0e1e8e5e443b96e3e6be7685ad90ff9746 /pcp-htop.c
parentb424a5b137797ef1b921b7ed1e6ee6521b7b65b0 (diff)
Implement command line and environment handling for pcp htop.
Diffstat (limited to 'pcp-htop.c')
-rw-r--r--pcp-htop.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/pcp-htop.c b/pcp-htop.c
new file mode 100644
index 00000000..eb81cfaa
--- /dev/null
+++ b/pcp-htop.c
@@ -0,0 +1,26 @@
+/*
+htop - pcp-htop.c
+(C) 2004-2011 Hisham H. Muhammad
+(C) 2020-2021 htop dev team
+Released under the GNU GPLv2, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h" // IWYU pragma: keep
+
+#include <pcp/pmapi.h>
+
+#include "CommandLine.h"
+#include "Platform.h"
+
+
+int main(int argc, char** argv) {
+ const char* name = "pcp-htop";
+ pmSetProgname(name);
+
+ /* extract environment variables */
+ opts.flags |= PM_OPTFLAG_ENV_ONLY;
+ pmGetOptions(argc, argv, &opts);
+
+ return CommandLine_run(name, argc, argv);
+}

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