summaryrefslogtreecommitdiff
path: root/src/bin/edje/edje_decc.c
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2013-12-23 10:48:08 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-12-23 10:48:13 +0900
commit574c5c1ba78d6a02f62b26e4070ef266b0d4bc8e (patch)
treec2c36f329b1d549deab180efe767d182ed35e801 /src/bin/edje/edje_decc.c
parent641d823cbbd68aab83cdcced0bc1847005957da5 (diff)
edje: edje_decc - added -output flag (save to specified dir)
Reviewers: cedric, seoz Reviewed By: cedric CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D402 Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
Diffstat (limited to 'src/bin/edje/edje_decc.c')
-rw-r--r--src/bin/edje/edje_decc.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/bin/edje/edje_decc.c b/src/bin/edje/edje_decc.c
index d85fb05808..fca3d332b0 100644
--- a/src/bin/edje/edje_decc.c
+++ b/src/bin/edje/edje_decc.c
@@ -22,6 +22,7 @@ int _edje_cc_log_dom = -1;
22static const char *progname = NULL; 22static const char *progname = NULL;
23char *file_in = NULL; 23char *file_in = NULL;
24char *file_out = NULL; 24char *file_out = NULL;
25char *outdir = NULL;
25int compress_mode = EET_COMPRESSION_DEFAULT; 26int compress_mode = EET_COMPRESSION_DEFAULT;
26 27
27Edje_File *edje_file = NULL; 28Edje_File *edje_file = NULL;
@@ -123,10 +124,11 @@ main_help(void)
123{ 124{
124 printf 125 printf
125 ("Usage:\n" 126 ("Usage:\n"
126 "\t%s input_file.edj [-main-out file.edc] [-no-build-sh] [-current-dir]\n" 127 "\t%s input_file.edj [-main-out file.edc] [-no-build-sh] [-current-dir | -output path_to_dir]\n"
127 "\n" 128 "\n"
128 " -main-out\tCreate a symbolic link to the main edc \n" 129 " -main-out\tCreate a symbolic link to the main edc \n"
129 " -no-build-sh\tDon't output build.sh \n" 130 " -no-build-sh\tDon't output build.sh \n"
131 " -output, -o\tOutput to specified directory \n"
130 " -current-dir\tOutput to current directory \n" 132 " -current-dir\tOutput to current directory \n"
131 " -quiet\t\tProduce less output\n" 133 " -quiet\t\tProduce less output\n"
132 "\n" 134 "\n"
@@ -179,6 +181,11 @@ main(int argc, char **argv)
179 new_dir = 0; 181 new_dir = 0;
180 else if (!strcmp(argv[i], "-quiet")) 182 else if (!strcmp(argv[i], "-quiet"))
181 eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_WARN); 183 eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_WARN);
184 else if ((!strcmp(argv[i], "-o") || !strcmp(argv[i], "-output")) && (i < (argc - 1)))
185 {
186 i++;
187 outdir = strdup(argv[i]);
188 }
182 } 189 }
183 if (!file_in) 190 if (!file_in)
184 { 191 {
@@ -257,20 +264,23 @@ output(void)
257 Eina_List *l; 264 Eina_List *l;
258 Eet_File *tef; 265 Eet_File *tef;
259 SrcFile *sf; 266 SrcFile *sf;
260 char *outdir, *p; 267 char *p;
261 268
262 if (!new_dir) 269 if (!outdir)
263 outdir = strdup(".");
264 else
265 { 270 {
266 p = strrchr(file_in, '/'); 271 if (!new_dir)
267 if (p) 272 outdir = strdup(".");
268 outdir = strdup(p + 1); 273 else
269 else 274 {
270 outdir = strdup(file_in); 275 p = strrchr(file_in, '/');
271 p = strrchr(outdir, '.'); 276 if (p)
272 if (p) *p = 0; 277 outdir = strdup(p + 1);
273 ecore_file_mkpath(outdir); 278 else
279 outdir = strdup(file_in);
280 p = strrchr(outdir, '.');
281 if (p) *p = 0;
282 ecore_file_mkpath(outdir);
283 }
274 } 284 }
275 285
276 286