diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2005-10-06 15:37:02 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2005-10-06 15:37:02 +0000 |
commit | 81c3a518d3121ac6a9fc991aabb916be95ebdea2 (patch) | |
tree | a74704314c1dcffbd472702e265966678a986a7c /include | |
parent | b31cb87fdce95d4bde2062e44e7a5408e97985c6 (diff) | |
download | busybox-81c3a518d3121ac6a9fc991aabb916be95ebdea2.tar.gz |
- pidof(8): make -s optional and optional -o; closes #168
first cut.
Diffstat (limited to 'include')
-rw-r--r-- | include/usage.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/include/usage.h b/include/usage.h index fad50efdc..bef6a4dd2 100644 --- a/include/usage.h +++ b/include/usage.h @@ -2160,16 +2160,37 @@ "$ patch -p1 <example.diff\n" \ "$ patch -p0 -i example.diff" +#if ENABLE_FEATURE_PIDOF_SINGLE +#define USAGE_FEATURE_PIDOF_SINGLE(a) a +#else +#define USAGE_FEATURE_PIDOF_SINGLE(a) +#endif +#if ENABLE_FEATURE_PIDOF_OMIT +#define USAGE_FEATURE_PIDOF_OMIT(a) a +#else +#define USAGE_FEATURE_PIDOF_OMIT(a) +#endif +#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT) +#define USAGE_PIDOF "Options:" +#else +#define USAGE_PIDOF "\n\tThis version of pidof accepts no options." +#endif + #define pidof_trivial_usage \ "process-name [OPTION] [process-name ...]" + #define pidof_full_usage \ "Lists the PIDs of all processes with names that match the\n" \ "names on the command line.\n" \ - "Options:\n" \ - "\t-s\t\tdisplay only a single PID" + USAGE_PIDOF \ + USAGE_FEATURE_PIDOF_SINGLE("\n\t-s\t\tdisplay only a single PID") \ + USAGE_FEATURE_PIDOF_OMIT("\n\t-o\t\tomit given pid.") \ + USAGE_FEATURE_PIDOF_OMIT("\n\t\t\tUse %PPID to omit the parent pid of pidof itself") #define pidof_example_usage \ "$ pidof init\n" \ - "1\n" + "1\n" \ + USAGE_FEATURE_PIDOF_OMIT("$ pidof /bin/sh\n20351 5973 5950\n") \ + USAGE_FEATURE_PIDOF_OMIT("$ pidof /bin/sh -o %PPID\n20351 5950") #ifndef CONFIG_FEATURE_FANCY_PING #define ping_trivial_usage "host" |