Skip to content

Commit eb680bd

Browse files
henrik242claude
andcommitted
add -v flag to show version
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a808224 commit eb680bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

envps.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@
2424
2525
*/
2626

27+
#include <cstring>
2728
#include <iostream>
2829
#include <exception>
2930
#include "process.hpp"
3031

32+
#define VERSION "1.5"
33+
3134
int main(int argc, char **argv) {
35+
if (argc == 2 && strcmp(argv[1], "-v") == 0) {
36+
std::cout << "envps " << VERSION << "\n";
37+
return 0;
38+
}
3239
if (argc != 2) {
33-
std::cerr << "Usage: envps <pid>" << "\n";
40+
std::cerr << "Usage: envps [-v] <pid>" << "\n";
3441
return 1;
3542
}
3643
int proc_id;

0 commit comments

Comments
 (0)