[pacman-dev] [PATCH 1/5] pacman-conf: accept short options
iff at escondida.tk
iff at escondida.tk
Fri Feb 9 04:49:04 UTC 2018
From: Ivy Foster <iff at escondida.tk>
Also change '-?' no longer to be an error, because if we're going to
check for it anyway, why make it an error?
Signed-off-by: Ivy Foster <iff at escondida.tk>
---
src/pacman/pacman-conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pacman/pacman-conf.c b/src/pacman/pacman-conf.c
index 1e6f55f9..5347a837 100644
--- a/src/pacman/pacman-conf.c
+++ b/src/pacman/pacman-conf.c
@@ -59,7 +59,7 @@ static void parse_opts(int argc, char **argv)
int c;
config_file = CONFFILE;
- const char *short_opts = "";
+ const char *short_opts = "c:hlR:r:Vv?";
struct option long_opts[] = {
{ "config" , required_argument , NULL , 'c' },
{ "rootdir" , required_argument , NULL , 'R' },
@@ -89,6 +89,7 @@ static void parse_opts(int argc, char **argv)
verbose = 1;
break;
case 'h':
+ case '?':
usage(0);
break;
case 'V':
@@ -96,7 +97,6 @@ static void parse_opts(int argc, char **argv)
cleanup();
exit(0);
break;
- case '?':
default:
usage(1);
break;
--
2.16.1
More information about the pacman-dev
mailing list