deluser: add optional support for removing users from groups
[oweals/busybox.git] / include / usage.h
index f4edf0556faaee721aef13a838cff7e513a35932..afcc4b3d794e36595586a80724e26a6d8f7f2878 100644 (file)
@@ -12,9 +12,9 @@
 #define __BB_USAGE_H__
 
 #define addgroup_trivial_usage \
-       "[-g GID] group_name [user_name]"
+       "[-g GID]"USE_FEATURE_ADDUSER_TO_GROUP(" [user_name]")" group_name"
 #define addgroup_full_usage \
-       "Add a group to the system" \
+       "Add a group to the system"USE_FEATURE_ADDUSER_TO_GROUP(" or add an user to a group") \
        "\n\nOptions:\n" \
        "       -g GID  Specify gid"
 
        "Deallocate unused virtual terminal /dev/ttyN"
 
 #define delgroup_trivial_usage \
-       "GROUP"
+        USE_FEATURE_DEL_USER_FROM_GROUP("[USER] ")"GROUP"
 #define delgroup_full_usage \
-       "Delete group GROUP from the system"
+       "Delete group GROUP from the system" \
+        USE_FEATURE_DEL_USER_FROM_GROUP(" or user USER from group GROUP")
 
 #define deluser_trivial_usage \
        "USER"
        ) USE_FEATURE_FIND_EXEC( \
        "\n     -exec CMD       Execute CMD with all instances of {} replaced by the" \
        "\n                     files matching EXPRESSION" \
+        ) USE_FEATURE_FIND_USER( \
+       "\n     -user NAME      File is owned by user NAME (numeric user ID allowed)" \
+       ) USE_FEATURE_FIND_GROUP( \
+       "\n     -group NAME     File belongs to group NAME (numeric group ID allowed)" \
+       ) USE_FEATURE_FIND_DEPTH( \
+       "\n     -depth          Process directory after traversing it" \
        ) USE_FEATURE_FIND_SIZE( \
        "\n     -size N         File size is N" \
        ) USE_FEATURE_FIND_PRUNE( \
        "\n     -prune          Stop traversing current subtree" \
+        ) USE_FEATURE_FIND_DELETE( \
+       "\n     -delete         Delete files; Turns on -depth option" \
+        ) USE_FEATURE_FIND_PATH( \
+       "\n     -path           Path matches PATTERN" \
        ) USE_FEATURE_FIND_PAREN( \
-       "\n     (expr)          Group" \
+       "\n     (EXPR)          Group an expression" \
        )
 
 #define find_example_usage \
        USE_SELINUX( \
        "\n     -Z      Set security context of copy" \
        )
-
+/* would need to make the " | " optional depending on more than one selected */
 #define ip_trivial_usage \
-       "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}"
+       "[OPTIONS] {" \
+       USE_FEATURE_IP_ADDRESS("address | ") \
+       USE_FEATURE_IP_ROUTE("route | ") \
+       USE_FEATURE_IP_LINK("link | ") \
+       USE_FEATURE_IP_TUNNEL("tunnel | ") \
+       USE_FEATURE_IP_RULE("rule") \
+       "} {COMMAND}"
 #define ip_full_usage \
        "ip [OPTIONS] OBJECT {COMMAND}\n" \
-       "where  OBJECT := {link | addr | route | tunnel |rule}\n" \
+       "where  OBJECT := {" \
+       USE_FEATURE_IP_ADDRESS("address | ") \
+       USE_FEATURE_IP_ROUTE("route | ") \
+       USE_FEATURE_IP_LINK("link | ") \
+       USE_FEATURE_IP_TUNNEL("tunnel | ") \
+       USE_FEATURE_IP_RULE("rule") \
+       "}\n" \
        "OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }"
 
 #define ipaddr_trivial_usage \
        " or\n" \
        "$ nameif -c /etc/my_mactab_file\n" \
 
+#if !ENABLE_DESKTOP
+
 #if ENABLE_NC_SERVER || ENABLE_NC_EXTRA
 #define NC_OPTIONS_STR "\n\nOptions:"
 #else
        "quit\n" \
        "221 foobar closing connection\n"
 
+#else /* DESKTOP nc - much more compatible with nc 1.10 */
+
+#define nc_trivial_usage \
+       "[-options] hostname port  - connect" \
+       USE_NC_SERVER("\nnc [-options] -l -p port [hostname] [port]  - listen")
+#define nc_full_usage \
+       USE_NC_SERVER( \
+       "-l             Listen mode, for inbound connects\n" \
+       ) \
+       "-n             Do not do DNS resolution" \
+     "\n-s addr                Local address" \
+     "\n-p port                Local port" \
+     "\n-u             UDP mode" \
+     "\n-v             Verbose (cumulative: -vv)" \
+     "\n-w secs                Timeout for connects and final net reads" \
+       USE_NC_EXTRA( \
+     "\n-i sec         Delay interval for lines sent" /* ", ports scanned" */ \
+     "\n-o file                Hex dump of traffic" \
+     "\n-z             Zero-I/O mode (scanning)" \
+       ) \
+     "\n-e prog [args] Program to exec after connect (must be last)" \
+/*   "\n-r             Randomize local and remote ports" */
+/*   "\n-g gateway     Source-routing hop point[s], up to 8" */
+/*   "\n-G num         Source-routing pointer: 4, 8, 12, ..." */
+/*   "\nport numbers can be individual or ranges: lo-hi [inclusive]" */
+
+#endif
+
+
 #define netstat_trivial_usage \
        "[-laenrtuwx]"
 #define netstat_full_usage \