1 /*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include <gtest/gtest.h>
17
18 #define private public
19 #include "bundle_command.h"
20 #undef private
21 #include "bundle_constants.h"
22 #include "bundle_installer_interface.h"
23 #include "iremote_broker.h"
24 #include "iremote_object.h"
25 #include "mock_bundle_mgr_host.h"
26 #include "mock_bundle_installer_host.h"
27
28 using namespace testing::ext;
29 using namespace OHOS;
30 using namespace OHOS::AAFwk;
31 using namespace OHOS::AppExecFwk;
32
33 class BmCommandInstallTest : public ::testing::Test {
34 public:
35 static void SetUpTestCase();
36 static void TearDownTestCase();
37 void SetUp() override;
38 void TearDown() override;
39
40 void MakeMockObjects();
41 void SetMockObjects(BundleManagerShellCommand &cmd) const;
42
43 std::string cmd_ = "install";
44 sptr<IBundleMgr> mgrProxyPtr_;
45 sptr<IBundleInstaller> installerProxyPtr_;
46 };
47
SetUpTestCase()48 void BmCommandInstallTest::SetUpTestCase()
49 {}
50
TearDownTestCase()51 void BmCommandInstallTest::TearDownTestCase()
52 {}
53
SetUp()54 void BmCommandInstallTest::SetUp()
55 {
56 // reset optind to 0
57 optind = 0;
58
59 // make mock objects
60 MakeMockObjects();
61 }
62
TearDown()63 void BmCommandInstallTest::TearDown()
64 {}
65
MakeMockObjects()66 void BmCommandInstallTest::MakeMockObjects()
67 {
68 // mock a mgr host
69 auto mgrHostPtr = sptr<IRemoteObject>(new MockBundleMgrHost());
70 // mock a mgr proxy
71 mgrProxyPtr_ = iface_cast<IBundleMgr>(mgrHostPtr);
72
73 // mock a installer host
74 auto installerHostPtr = sptr<IRemoteObject>(new MockBundleInstallerHost());
75 // mock a installer proxy
76 installerProxyPtr_ = iface_cast<IBundleInstaller>(installerHostPtr);
77 }
78
SetMockObjects(BundleManagerShellCommand & cmd) const79 void BmCommandInstallTest::SetMockObjects(BundleManagerShellCommand &cmd) const
80 {
81 // set the mock mgr proxy
82 cmd.bundleMgrProxy_ = mgrProxyPtr_;
83
84 // set the mock installer proxy
85 cmd.bundleInstallerProxy_ = installerProxyPtr_;
86 }
87
88 /**
89 * @tc.number: Bm_Command_Install_0100
90 * @tc.name: ExecCommand
91 * @tc.desc: Verify the "bm install" command.
92 */
93 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0100, Function | MediumTest | Level1)
94 {
95 char *argv[] = {
96 (char *)TOOL_NAME.c_str(),
97 (char *)cmd_.c_str(),
98 (char *)"",
99 };
100 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
101
102 BundleManagerShellCommand cmd(argc, argv);
103
104 // set the mock objects
105 SetMockObjects(cmd);
106
107 EXPECT_EQ(cmd.ExecCommand(), HELP_MSG_NO_OPTION + "\n" + HELP_MSG_INSTALL);
108 }
109
110 /**
111 * @tc.number: Bm_Command_Install_0200
112 * @tc.name: ExecCommand
113 * @tc.desc: Verify the "bm install xxx" command.
114 */
115 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0200, Function | MediumTest | Level1)
116 {
117 char *argv[] = {
118 (char *)TOOL_NAME.c_str(),
119 (char *)cmd_.c_str(),
120 (char *)"xxx",
121 (char *)"",
122 };
123 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
124
125 BundleManagerShellCommand cmd(argc, argv);
126
127 // set the mock objects
128 SetMockObjects(cmd);
129
130 EXPECT_EQ(cmd.ExecCommand(), HELP_MSG_NO_OPTION + "\n" + HELP_MSG_INSTALL);
131 }
132
133 /**
134 * @tc.number: Bm_Command_Install_0300
135 * @tc.name: ExecCommand
136 * @tc.desc: Verify the "bm install -x" command.
137 */
138 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0300, Function | MediumTest | Level1)
139 {
140 char *argv[] = {
141 (char *)TOOL_NAME.c_str(),
142 (char *)cmd_.c_str(),
143 (char *)"-x",
144 (char *)"",
145 };
146 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
147
148 BundleManagerShellCommand cmd(argc, argv);
149
150 // set the mock objects
151 SetMockObjects(cmd);
152
153 EXPECT_EQ(cmd.ExecCommand(), "error: unknown option.\n" + HELP_MSG_INSTALL);
154 }
155
156 /**
157 * @tc.number: Bm_Command_Install_0400
158 * @tc.name: ExecCommand
159 * @tc.desc: Verify the "bm install -xxx" command.
160 */
161 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0400, Function | MediumTest | Level1)
162 {
163 char *argv[] = {
164 (char *)TOOL_NAME.c_str(),
165 (char *)cmd_.c_str(),
166 (char *)"-xxx",
167 (char *)"",
168 };
169 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
170
171 BundleManagerShellCommand cmd(argc, argv);
172
173 // set the mock objects
174 SetMockObjects(cmd);
175
176 EXPECT_EQ(cmd.ExecCommand(), "error: unknown option.\n" + HELP_MSG_INSTALL);
177 }
178
179 /**
180 * @tc.number: Bm_Command_Install_0500
181 * @tc.name: ExecCommand
182 * @tc.desc: Verify the "bm install --x" command.
183 */
184 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0500, Function | MediumTest | Level1)
185 {
186 char *argv[] = {
187 (char *)TOOL_NAME.c_str(),
188 (char *)cmd_.c_str(),
189 (char *)"--x",
190 (char *)"",
191 };
192 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
193
194 BundleManagerShellCommand cmd(argc, argv);
195
196 // set the mock objects
197 SetMockObjects(cmd);
198
199 EXPECT_EQ(cmd.ExecCommand(), "error: unknown option.\n" + HELP_MSG_INSTALL);
200 }
201
202 /**
203 * @tc.number: Bm_Command_Install_0600
204 * @tc.name: ExecCommand
205 * @tc.desc: Verify the "bm install --xxx" command.
206 */
207 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0600, Function | MediumTest | Level1)
208 {
209 char *argv[] = {
210 (char *)TOOL_NAME.c_str(),
211 (char *)cmd_.c_str(),
212 (char *)"--xxx",
213 (char *)"",
214 };
215 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
216
217 BundleManagerShellCommand cmd(argc, argv);
218
219 // set the mock objects
220 SetMockObjects(cmd);
221
222 EXPECT_EQ(cmd.ExecCommand(), "error: unknown option.\n" + HELP_MSG_INSTALL);
223 }
224
225 /**
226 * @tc.number: Bm_Command_Install_0700
227 * @tc.name: ExecCommand
228 * @tc.desc: Verify the "bm install --h" command.
229 */
230 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0700, Function | MediumTest | Level1)
231 {
232 char *argv[] = {
233 (char *)TOOL_NAME.c_str(),
234 (char *)cmd_.c_str(),
235 (char *)"-h",
236 (char *)"",
237 };
238 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
239
240 BundleManagerShellCommand cmd(argc, argv);
241
242 // set the mock objects
243 SetMockObjects(cmd);
244
245 EXPECT_EQ(cmd.ExecCommand(), HELP_MSG_INSTALL);
246 }
247
248 /**
249 * @tc.number: Bm_Command_Install_0800
250 * @tc.name: ExecCommand
251 * @tc.desc: Verify the "bm install --help" command.
252 */
253 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0800, Function | MediumTest | Level1)
254 {
255 char *argv[] = {
256 (char *)TOOL_NAME.c_str(),
257 (char *)cmd_.c_str(),
258 (char *)"--help",
259 (char *)"",
260 };
261 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
262
263 BundleManagerShellCommand cmd(argc, argv);
264
265 // set the mock objects
266 SetMockObjects(cmd);
267
268 EXPECT_EQ(cmd.ExecCommand(), HELP_MSG_INSTALL);
269 }
270
271 /**
272 * @tc.number: Bm_Command_Install_0900
273 * @tc.name: ExecCommand
274 * @tc.desc: Verify the "bm install -p" command.
275 */
276 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_0900, Function | MediumTest | Level1)
277 {
278 char *argv[] = {
279 (char *)TOOL_NAME.c_str(),
280 (char *)cmd_.c_str(),
281 (char *)"-p",
282 (char *)"",
283 };
284 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
285
286 BundleManagerShellCommand cmd(argc, argv);
287
288 // set the mock objects
289 SetMockObjects(cmd);
290
291 EXPECT_EQ(cmd.ExecCommand(), "error: option requires a value.\n" + HELP_MSG_INSTALL);
292 }
293
294 /**
295 * @tc.number: Bm_Command_Install_1000
296 * @tc.name: ExecCommand
297 * @tc.desc: Verify the "bm install -r" command.
298 */
299 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1000, Function | MediumTest | Level1)
300 {
301 char *argv[] = {
302 (char *)TOOL_NAME.c_str(),
303 (char *)cmd_.c_str(),
304 (char *)"-r",
305 (char *)"",
306 };
307 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
308
309 BundleManagerShellCommand cmd(argc, argv);
310
311 // set the mock objects
312 SetMockObjects(cmd);
313
314 EXPECT_EQ(
315 cmd.ExecCommand(), "error: you must specify a bundle path with '-p' or '--bundle-path'.\n" + HELP_MSG_INSTALL);
316 }
317
318 /**
319 * @tc.number: Bm_Command_Install_1100
320 * @tc.name: ExecCommand
321 * @tc.desc: Verify the "bm install -p <bundle-path>" command.
322 */
323 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1100, Function | MediumTest | Level1)
324 {
325 // install a bundle
326 char *argv[] = {
327 (char *)TOOL_NAME.c_str(),
328 (char *)cmd_.c_str(),
329 (char *)"-p",
330 (char *)STRING_BUNDLE_PATH.c_str(),
331 (char *)"",
332 };
333 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
334
335 BundleManagerShellCommand cmd(argc, argv);
336
337 // set the mock objects
338 SetMockObjects(cmd);
339
340 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
341 }
342
343 /**
344 * @tc.number: Bm_Command_Install_1200
345 * @tc.name: ExecCommand
346 * @tc.desc: Verify the "bm install -p <bundle-path> -r" command.
347 */
348 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1200, Function | MediumTest | Level1)
349 {
350 // install a bundle
351 char *argv[] = {
352 (char *)TOOL_NAME.c_str(),
353 (char *)cmd_.c_str(),
354 (char *)"-p",
355 (char *)STRING_BUNDLE_PATH.c_str(),
356 (char *)"-r",
357 (char *)"",
358 };
359 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
360
361 BundleManagerShellCommand cmd(argc, argv);
362
363 // set the mock objects
364 SetMockObjects(cmd);
365
366 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
367 }
368
369 /**
370 * @tc.number: Bm_Command_Install_1300
371 * @tc.name: ExecCommand
372 * @tc.desc: Verify the "bm install -r -p <bundle-path>" command.
373 */
374 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1300, Function | MediumTest | Level1)
375 {
376 // install a bundle
377 char *argv[] = {
378 (char *)TOOL_NAME.c_str(),
379 (char *)cmd_.c_str(),
380 (char *)"-r",
381 (char *)"-p",
382 (char *)STRING_BUNDLE_PATH.c_str(),
383 (char *)"",
384 };
385 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
386
387 BundleManagerShellCommand cmd(argc, argv);
388
389 // set the mock objects
390 SetMockObjects(cmd);
391
392 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
393 }
394
395 /**
396 * @tc.number: Bm_Command_Install_1600
397 * @tc.name: ExecCommand
398 * @tc.desc: Verify the "bm install -p <bundle-path> <bundle-path>" command.
399 * @tc.require: AR000GJ4K9
400 */
401 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1600, Function | MediumTest | Level1)
402 {
403 // install a bundle
404 char *argv[] = {
405 (char *)TOOL_NAME.c_str(),
406 (char *)cmd_.c_str(),
407 (char *)"-p",
408 (char *)STRING_BUNDLE_PATH.c_str(),
409 (char *)STRING_OTHER_BUNDLE_PATH.c_str(),
410 (char *)"",
411 };
412 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
413
414 BundleManagerShellCommand cmd(argc, argv);
415
416 // set the mock objects
417 SetMockObjects(cmd);
418
419 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
420 }
421
422 /**
423 * @tc.number: Bm_Command_Install_1700
424 * @tc.name: ExecCommand
425 * @tc.desc: Verify the "bm install -p <bundle-path>" command.
426 * @tc.require: AR000GJ4K9
427 */
428 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1700, Function | MediumTest | Level1)
429 {
430 // install a bundle
431 char *argv[] = {
432 (char *)TOOL_NAME.c_str(),
433 (char *)cmd_.c_str(),
434 (char *)"-p",
435 (char *)STRING_BUNDLE_INSTALL_PATH1.c_str(),
436 (char *)STRING_BUNDLE_INSTALL_PATH2.c_str(),
437 (char *)"",
438 };
439 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
440
441 BundleManagerShellCommand cmd(argc, argv);
442
443 // set the mock objects
444 SetMockObjects(cmd);
445
446 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
447 }
448
449 /**
450 * @tc.number: Bm_Command_Install_1800
451 * @tc.name: ExecCommand
452 * @tc.desc: Verify the "bm install -p <bundle-path>" command.
453 * @tc.require: AR000GJ4K9
454 */
455 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1800, Function | MediumTest | Level1)
456 {
457 // install a bundle
458 char *argv[] = {
459 (char *)TOOL_NAME.c_str(),
460 (char *)cmd_.c_str(),
461 (char *)"-p",
462 (char *)STRING_BUNDLE_PATH.c_str(),
463 (char *)STRING_BUNDLE_INSTALL_PATH2.c_str(),
464 (char *)"",
465 };
466 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
467
468 BundleManagerShellCommand cmd(argc, argv);
469
470 // set the mock objects
471 SetMockObjects(cmd);
472
473 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
474 }
475
476 /**
477 * @tc.number: Bm_Command_Install_1900
478 * @tc.name: ExecCommand
479 * @tc.desc: Verify the "bm install --bundle-path <bundle-path> <bundle-path>" command.
480 * @tc.require: AR000GJ4K9
481 */
482 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_1900, Function | MediumTest | Level1)
483 {
484 // install a bundle
485 char *argv[] = {
486 (char *)TOOL_NAME.c_str(),
487 (char *)cmd_.c_str(),
488 (char *)"--bundle-path",
489 (char *)STRING_BUNDLE_PATH.c_str(),
490 (char *)STRING_OTHER_BUNDLE_PATH.c_str(),
491 (char *)"",
492 };
493 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
494
495 BundleManagerShellCommand cmd(argc, argv);
496
497 // set the mock objects
498 SetMockObjects(cmd);
499
500 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
501 }
502
503 /**
504 * @tc.number: Bm_Command_Install_2000
505 * @tc.name: ExecCommand
506 * @tc.desc: Verify the "bm install -p <bundle-path>" command.
507 * @tc.require: AR000GJ4K9
508 */
509 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_2000, Function | MediumTest | Level1)
510 {
511 // install a bundle
512 char *argv[] = {
513 (char *)TOOL_NAME.c_str(),
514 (char *)cmd_.c_str(),
515 (char *)"--bundle-path",
516 (char *)STRING_BUNDLE_INSTALL_PATH1.c_str(),
517 (char *)STRING_BUNDLE_INSTALL_PATH2.c_str(),
518 (char *)"",
519 };
520 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
521
522 BundleManagerShellCommand cmd(argc, argv);
523
524 // set the mock objects
525 SetMockObjects(cmd);
526
527 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
528 }
529
530 /**
531 * @tc.number: Bm_Command_Install_2100
532 * @tc.name: ExecCommand
533 * @tc.desc: Verify the "bm install -p <bundle-path>" command.
534 * @tc.require: AR000GJ4K9
535 */
536 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_2100, Function | MediumTest | Level1)
537 {
538 // install a bundle
539 char *argv[] = {
540 (char *)TOOL_NAME.c_str(),
541 (char *)cmd_.c_str(),
542 (char *)"--bundle-path",
543 (char *)STRING_BUNDLE_PATH.c_str(),
544 (char *)STRING_BUNDLE_INSTALL_PATH2.c_str(),
545 (char *)"",
546 };
547 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
548
549 BundleManagerShellCommand cmd(argc, argv);
550
551 // set the mock objects
552 SetMockObjects(cmd);
553
554 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
555 }
556
557 /**
558 * @tc.number: Bm_Command_Install_2300
559 * @tc.name: ExecCommand
560 * @tc.desc: Verify the "bm install -p <bundle-path> <bundle-path> -r" command.
561 * @tc.require: AR000GJ4K9
562 */
563 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_2300, Function | MediumTest | Level1)
564 {
565 // install a bundle
566 char *argv[] = {
567 (char *)TOOL_NAME.c_str(),
568 (char *)cmd_.c_str(),
569 (char *)"-p",
570 (char *)STRING_BUNDLE_PATH.c_str(),
571 (char *)STRING_OTHER_BUNDLE_PATH.c_str(),
572 (char *)"-r",
573 (char *)"",
574 };
575 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
576
577 BundleManagerShellCommand cmd(argc, argv);
578
579 // set the mock objects
580 SetMockObjects(cmd);
581
582 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
583 }
584
585 /**
586 * @tc.number: Bm_Command_Install_2400
587 * @tc.name: ExecCommand
588 * @tc.desc: Verify the "bm install -r -p <bundle-path> <bundle-path>" command.
589 * @tc.require: AR000GJ4K9
590 */
591 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_2400, Function | MediumTest | Level1)
592 {
593 // install a bundle
594 char *argv[] = {
595 (char *)TOOL_NAME.c_str(),
596 (char *)cmd_.c_str(),
597 (char *)"-r",
598 (char *)"-p",
599 (char *)STRING_BUNDLE_PATH.c_str(),
600 (char *)STRING_OTHER_BUNDLE_PATH.c_str(),
601 (char *)"",
602 };
603 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
604
605 BundleManagerShellCommand cmd(argc, argv);
606
607 // set the mock objects
608 SetMockObjects(cmd);
609
610 EXPECT_EQ(cmd.ExecCommand(), STRING_INSTALL_BUNDLE_OK + "\n");
611 }
612
613 /**
614 * @tc.number: Bm_Command_Install_2600
615 * @tc.name: ExecCommand
616 * @tc.desc: Verify the "bm install -p -r <bundle-path> <bundle-path>" command.
617 * @tc.require: AR000GJ4K9
618 */
619 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_2600, Function | MediumTest | Level1)
620 {
621 // install a bundle
622 char *argv[] = {
623 (char *)TOOL_NAME.c_str(),
624 (char *)cmd_.c_str(),
625 (char *)"-p",
626 (char *)"-r",
627 (char *)STRING_BUNDLE_PATH.c_str(),
628 (char *)STRING_OTHER_BUNDLE_PATH.c_str(),
629 (char *)"",
630 };
631 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
632
633 BundleManagerShellCommand cmd(argc, argv);
634
635 // set the mock objects
636 SetMockObjects(cmd);
637
638 EXPECT_EQ(cmd.ExecCommand(), "error: option requires a correct value.\n");
639 }
640
641 /**
642 * @tc.number: Bm_Command_Install_2700
643 * @tc.name: ExecCommand
644 * @tc.desc: Verify the "bm install -p -f <bundle-path> <bundle-path>" command.
645 * @tc.require: AR000GJ4K9
646 */
647 HWTEST_F(BmCommandInstallTest, Bm_Command_Install_2700, Function | MediumTest | Level1)
648 {
649 // install a bundle
650 char *argv[] = {
651 (char *)TOOL_NAME.c_str(),
652 (char *)cmd_.c_str(),
653 (char *)"-p",
654 (char *)"-f",
655 (char *)STRING_BUNDLE_PATH.c_str(),
656 (char *)STRING_OTHER_BUNDLE_PATH.c_str(),
657 (char *)"",
658 };
659 int argc = sizeof(argv) / sizeof(argv[0]) - 1;
660
661 BundleManagerShellCommand cmd(argc, argv);
662
663 // set the mock objects
664 SetMockObjects(cmd);
665
666 EXPECT_EQ(cmd.ExecCommand(), "error: option requires a correct value.\n");
667 }