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
From 6aceba4f68bb4f5b10b916fb2eebc16dd5c5a45d Mon Sep 17 00:00:00 2001
From: Xabier Oneca <xon...@gmail.com>
Date: Tue, 8 Aug 2017 21:32:34 +0200
Subject: [PATCH] chcon: trivial usage: '--reference' now depends on LONG_OPTS

In the commit 036585a911a5fe6c2cd77b808dd9150500f37272 (getopt32: remove
applet_long_options) the option FEATURE_CHCON_LONG_OPTIONS is removed in favour
of general LONG_OPTS, but '--reference' is left unconditionally in
chcon_trivial_usage.

Restore the condition, but this time using LONG_OPTS.

Signed-off-by: Xabier Oneca <xon...@gmail.com>
---
 selinux/chcon.c | 2 ++
 1 file changed, 2 insertions(+)

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

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to