Mercurial > hg > index.cgi
comparison lwar/main.c @ 427:45df37e81741
Add option to ignore paths when extracting or adding files with lwar
Add option to lwar to strip path names from filenames when objects are added
to an archive. Also strip path names from objects when extracting them, if
present.
author | David Flamand <dlflamand@gmail.com> |
---|---|
date | Tue, 15 Nov 2016 21:43:33 -0700 |
parents | 221b5f58d8ad |
children | c5841e2c745d |
comparison
equal
deleted
inserted
replaced
426:b4825b42c151 | 427:45df37e81741 |
---|---|
48 switch (key) | 48 switch (key) |
49 { | 49 { |
50 case 'd': | 50 case 'd': |
51 // debug | 51 // debug |
52 debug_level++; | 52 debug_level++; |
53 break; | |
54 | |
55 case 'f': | |
56 // filename only, no path | |
57 filename_flag++; | |
53 break; | 58 break; |
54 | 59 |
55 case 'a': | 60 case 'a': |
56 // add members | 61 // add members |
57 operation = LWAR_OP_ADD; | 62 operation = LWAR_OP_ADD; |
109 "List the contents of the archive" }, | 114 "List the contents of the archive" }, |
110 { "create", 'c', 0, 0, | 115 { "create", 'c', 0, 0, |
111 "Create new archive (or truncate existing one)" }, | 116 "Create new archive (or truncate existing one)" }, |
112 { "merge", 'm', 0, 0, | 117 { "merge", 'm', 0, 0, |
113 "Add the contents of archive arguments instead of the archives themselves" }, | 118 "Add the contents of archive arguments instead of the archives themselves" }, |
119 { "filename", 'f', 0, 0, | |
120 "Prevent the path from being archived" }, | |
114 { "debug", 'd', 0, 0, | 121 { "debug", 'd', 0, 0, |
115 "Set debug mode"}, | 122 "Set debug mode"}, |
116 { 0 } | 123 { 0 } |
117 }; | 124 }; |
118 | 125 |