summaryrefslogtreecommitdiffstats
path: root/scripts/wic
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/wic')
-rwxr-xr-xscripts/wic16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/wic b/scripts/wic
index ea614100c2..24700f380f 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -392,9 +392,9 @@ def imgpathtype(arg):
392 392
393def wic_init_parser_cp(subparser): 393def wic_init_parser_cp(subparser):
394 subparser.add_argument("src", 394 subparser.add_argument("src",
395 help="source spec") 395 help="image spec: <image>:<vfat partition>[<path>] or <file>")
396 subparser.add_argument("dest", type=imgpathtype, 396 subparser.add_argument("dest",
397 help="image spec: <image>:<vfat partition>[<path>]") 397 help="image spec: <image>:<vfat partition>[<path>] or <file>")
398 subparser.add_argument("-n", "--native-sysroot", 398 subparser.add_argument("-n", "--native-sysroot",
399 help="path to the native sysroot containing the tools") 399 help="path to the native sysroot containing the tools")
400 400
@@ -522,6 +522,16 @@ def main(argv):
522 hlpt[0](hlpt[1], hlpt[2]) 522 hlpt[0](hlpt[1], hlpt[2])
523 return 0 523 return 0
524 524
525 # validate wic cp src and dest parameter to identify which one of it is
526 # image and cast it into imgtype
527 if args.command == "cp":
528 if ":" in args.dest:
529 args.dest = imgtype(args.dest)
530 elif ":" in args.src:
531 args.src = imgtype(args.src)
532 else:
533 raise argparse.ArgumentTypeError("no image or partition number specified.")
534
525 return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands) 535 return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands)
526 536
527 537