aboutsummaryrefslogtreecommitdiff
path: root/archival/ar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/ar.c')
-rw-r--r--archival/ar.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/archival/ar.c b/archival/ar.c
index ea36bda88..d113bc6ca 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -254,11 +254,16 @@ int ar_main(int argc UNUSED_PARAM, char **argv)
254 254
255 archive_handle = init_handle(); 255 archive_handle = init_handle();
256 256
257 /* --: prepend '-' to the first argument if required */ 257 /* prepend '-' to the first argument if required */
258 /* -1: at least one param is reqd */ 258 if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0')
259 /* one of p,t,x[,r] is required */ 259 argv[1] = xasprintf("-%s", argv[1]);
260 opt_complementary = "--:-1:p:t:x"IF_FEATURE_AR_CREATE(":r"); 260 opt = getopt32(argv, "^"
261 opt = getopt32(argv, "voc""ptx"IF_FEATURE_AR_CREATE("r")); 261 "voc""ptx"IF_FEATURE_AR_CREATE("r")
262 "\0"
263 /* -1: at least one arg is reqd */
264 /* one of p,t,x[,r] is required */
265 "-1:p:t:x"IF_FEATURE_AR_CREATE(":r")
266 );
262 argv += optind; 267 argv += optind;
263 268
264 t = opt / FIRST_CMD; 269 t = opt / FIRST_CMD;