Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afm-binding: Common code getting application id
[src/app-framework-main.git]
/
src
/
wgtpkg-pack.c
diff --git
a/src/wgtpkg-pack.c
b/src/wgtpkg-pack.c
index
483ec89
..
0f5f70c
100644
(file)
--- a/
src/wgtpkg-pack.c
+++ b/
src/wgtpkg-pack.c
@@
-1,5
+1,7
@@
/*
/*
- Copyright 2015 IoT.bzh
+ Copyright 2015, 2016, 2017 IoT.bzh
+
+ author: José Bollo <jose.bollo@iot.bzh>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@
-26,20
+28,26
@@
#include <fcntl.h>
#include "verbose.h"
#include <fcntl.h>
#include "verbose.h"
-#include "wgtpkg.h"
-
-#if !defined(MAXCERT)
-#define MAXCERT 20
-#endif
-#if !defined(DEFAULT_KEY_FILE)
-#define DEFAULT_KEY_FILE "key.pem"
-#endif
-#if !defined(DEFAULT_CERT_FILE)
-#define DEFAULT_CERT_FILE "cert.pem"
-#endif
+#include "wgtpkg-files.h"
+#include "wgtpkg-workdir.h"
+#include "wgtpkg-zip.h"
const char appname[] = "wgtpkg-pack";
const char appname[] = "wgtpkg-pack";
+static void version()
+{
+ printf(
+ "\n"
+ " %s version="AFM_VERSION"\n"
+ "\n"
+ " Copyright (C) 2015, 2016, 2017 \"IoT.bzh\"\n"
+ " AFB comes with ABSOLUTELY NO WARRANTY.\n"
+ " Licence Apache 2\n"
+ "\n",
+ appname
+ );
+}
+
static void usage()
{
printf(
static void usage()
{
printf(
@@
-49,6
+57,7
@@
static void usage()
" -f force overwriting\n"
" -q quiet\n"
" -v verbose\n"
" -f force overwriting\n"
" -q quiet\n"
" -v verbose\n"
+ " -V version\n"
"\n",
appname
);
"\n",
appname
);
@@
-60,6
+69,7
@@
static struct option options[] = {
{ "help", no_argument, NULL, 'h' },
{ "quiet", no_argument, NULL, 'q' },
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ "quiet", no_argument, NULL, 'q' },
{ "verbose", no_argument, NULL, 'v' },
+ { "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};
{ NULL, 0, NULL, 0 }
};
@@
-75,7
+85,7
@@
int main(int ac, char **av)
force = 0;
wgtfile = directory = NULL;
for (;;) {
force = 0;
wgtfile = directory = NULL;
for (;;) {
- i = getopt_long(ac, av, "qvhfo:", options, NULL);
+ i = getopt_long(ac, av, "qv
V
hfo:", options, NULL);
if (i < 0)
break;
switch (i) {
if (i < 0)
break;
switch (i) {
@@
-95,6
+105,9
@@
int main(int ac, char **av)
case 'h':
usage();
return 0;
case 'h':
usage();
return 0;
+ case 'V':
+ version();
+ return 0;
case ':':
ERROR("missing argument");
return 1;
case ':':
ERROR("missing argument");
return 1;