[PATCH] chcon: trivial usage: '--reference' now depends on LONG_OPTS

Xabier Oneca -- xOneca xoneca at gmail.com
Tue Aug 8 20:02:29 UTC 2017


Hello,

In one of the lastest mega-commits
(036585a911a5fe6c2cd77b808dd9150500f37272 getopt32: remove
applet_long_options) I've spotted (don't ask how ;) ) that in the
chcon trivial usage now '--reference' is unconditionally displayed
whether LONG_OPTS is enabled or not. This doesn't match
'chcon_full_usage'.

This is my first patch, so review twice!

Cheers,
Xabier Oneca_,,_

diff --git a/selinux/chcon.c b/selinux/chcon.c
index 3cf9e92..05e8088 100644
--- a/selinux/chcon.c
+++ b/selinux/chcon.c
@@ -21,7 +21,9 @@
 //usage:#define chcon_trivial_usage
 //usage:       "[OPTIONS] CONTEXT FILE..."
 //usage:       "\n    chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE]
[-t TYPE] FILE..."
+//usage:    IF_LONG_OPTS(
 //usage:       "\n    chcon [OPTIONS] --reference=RFILE FILE..."
+//usage:    )
 //usage:
 //usage:#define chcon_full_usage "\n\n"
 //usage:       "Change the security context of each FILE to CONTEXT\n"
-- 
2.13.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-chcon-trivial-usage-reference-now-depends-on-LONG_OP.patch
Type: text/x-patch
Size: 1171 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20170808/9737cec2/attachment.bin>


More information about the busybox mailing list