diff options
author | Ian C <ianc@noddybox.co.uk> | 2016-05-11 09:18:52 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2016-05-11 09:18:52 +0100 |
commit | e60cc5a36c148ef5ea0e38bcc848cf32f2b54a18 (patch) | |
tree | 0170a51b02b56d17e2b9e4c4e4716aaf0e4ac3c5 /src/casm.c | |
parent | 728bbf0dee1e66c30fa57f278d4a82e576f6398b (diff) |
Added option to import only labels from library.
Diffstat (limited to 'src/casm.c')
-rw-r--r-- | src/casm.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -511,7 +511,23 @@ static CommandStatus IMPORT(const char *label, int argc, char *argv[], { CMD_ARGC_CHECK(2); - return LibLoad(argv[1], LibLoadAll, err, errsize) ? CMD_OK : CMD_FAILED; + if (argc == 3) + { + if (CompareString(argv[2], "labels")) + { + return LibLoad(argv[1], LibLoadLabels, err, errsize) ? + CMD_OK : CMD_FAILED; + } + else + { + snprintf(err, errsize, "%s: unknown argument %s", argv[0], argv[2]); + return CMD_FAILED; + } + } + else + { + return LibLoad(argv[1], LibLoadAll, err, errsize) ? CMD_OK : CMD_FAILED; + } } |