diff options
| author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-03-11 15:58:30 +0100 | 
|---|---|---|
| committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-03-11 15:58:30 +0100 | 
| commit | 2b485906cfa6d2e0431b0fa0120e1c267074b4e8 (patch) | |
| tree | 152720e5925a6f772fc8275c32bd3976f8943a25 /src/blogc-make/main.c | |
| parent | acf14b6fafd39e46ba343fd069bed205d7c35fb9 (diff) | |
| download | blogc-2b485906cfa6d2e0431b0fa0120e1c267074b4e8.tar.gz blogc-2b485906cfa6d2e0431b0fa0120e1c267074b4e8.tar.bz2 blogc-2b485906cfa6d2e0431b0fa0120e1c267074b4e8.zip | |
make: all builds are "production" by default, enable "dev" on cli.
this is more consistent with other similar tools, and enables us to add
something like a [copy:dev] section later, that will avoid copying dev
files to production builds.
Diffstat (limited to 'src/blogc-make/main.c')
| -rw-r--r-- | src/blogc-make/main.c | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/src/blogc-make/main.c b/src/blogc-make/main.c index eb7f504..8c73e13 100644 --- a/src/blogc-make/main.c +++ b/src/blogc-make/main.c @@ -25,7 +25,7 @@ print_help(void)  {      printf(          "usage:\n" -        "    blogc-make [-h] [-v] [-V] [-f FILE] [RULE ...]\n" +        "    blogc-make [-h] [-v] [-D] [-V] [-f FILE] [RULE ...]\n"          "               - A simple build tool for blogc.\n"          "\n"          "positional arguments:\n" @@ -35,9 +35,9 @@ print_help(void)          "optional arguments:\n"          "    -h            show this help message and exit\n"          "    -v            show version and exit\n" +        "    -D            build for development environment\n"          "    -V            be verbose when executing commands\n" -        "    -f FILE       read FILE as blogcfile\n" -        "    -p            build for production environment\n"); +        "    -f FILE       read FILE as blogcfile\n");      bm_rule_print_help();  } @@ -45,7 +45,7 @@ print_help(void)  static void  print_usage(void)  { -    printf("usage: blogc-make [-h] [-v] [-V] [-f FILE] [-p] [RULE ...]\n"); +    printf("usage: blogc-make [-h] [-v] [-D] [-V] [-f FILE] [RULE ...]\n");  } @@ -63,7 +63,7 @@ main(int argc, char **argv)      bc_slist_t *rules = NULL;      bool verbose = false; -    bool production = false; +    bool dev = false;      char *blogcfile = NULL;      bm_ctx_t *ctx = NULL; @@ -76,6 +76,9 @@ main(int argc, char **argv)                  case 'v':                      printf("%s\n", PACKAGE_STRING);                      goto cleanup; +                case 'D': +                    dev = true; +                    break;                  case 'V':                      verbose = true;                      break; @@ -85,9 +88,6 @@ main(int argc, char **argv)                      else if (i + 1 < argc)                          blogcfile = bc_strdup(argv[++i]);                      break; -                case 'p': -                    production = true; -                    break;  #ifdef MAKE_EMBEDDED                  case 'm':                      // no-op, for embedding into blogc binary. @@ -117,7 +117,7 @@ main(int argc, char **argv)          rv = 3;          goto cleanup;      } -    ctx->production = production; +    ctx->dev = dev;      ctx->verbose = verbose;      rv = bm_rule_executor(ctx, rules); | 
