diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-03 21:18:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-03 21:18:10 +0200 |
commit | 90d92b359de4e5c52a1ff0b9272b5005484e7941 (patch) | |
tree | a8c667204e996567c0220ea2e4ee644fb052d645 /scripts/bareboxenv.c | |
parent | edf068e9cf18d3b756c606cbd1d9ce312640646a (diff) | |
parent | c8c49c14aef009a86f238c4bdaf78b1d01b7bdcf (diff) | |
download | barebox-90d92b359de4e5c52a1ff0b9272b5005484e7941.tar.gz barebox-90d92b359de4e5c52a1ff0b9272b5005484e7941.tar.xz |
Merge branch 'for-next/defaultenv-deps'
Diffstat (limited to 'scripts/bareboxenv.c')
-rw-r--r-- | scripts/bareboxenv.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/bareboxenv.c b/scripts/bareboxenv.c index a4aec942b4..f44a1f89d5 100644 --- a/scripts/bareboxenv.c +++ b/scripts/bareboxenv.c @@ -130,7 +130,8 @@ void usage(char *prgname) "options:\n" " -s save (directory -> environment sector)\n" " -l load (environment sector -> directory)\n" - " -p <size> pad output file to given size\n", + " -p <size> pad output file to given size\n" + " -v verbose\n", prgname); } @@ -139,8 +140,9 @@ int main(int argc, char *argv[]) int opt; int save = 0, load = 0, pad = 0, fd; char *filename = NULL, *dirname = NULL; + int verbose = 0; - while((opt = getopt(argc, argv, "slp:")) != -1) { + while((opt = getopt(argc, argv, "slp:v")) != -1) { switch (opt) { case 's': save = 1; @@ -151,6 +153,9 @@ int main(int argc, char *argv[]) case 'p': pad = strtoul(optarg, NULL, 0); break; + case 'v': + verbose = 1; + break; } } @@ -184,11 +189,13 @@ int main(int argc, char *argv[]) } if (load) { - printf("loading env from file %s to %s\n", filename, dirname); + if (verbose) + printf("loading env from file %s to %s\n", filename, dirname); envfs_load(filename, dirname); } if (save) { - printf("saving contents of %s to file %s\n", dirname, filename); + if (verbose) + printf("saving contents of %s to file %s\n", dirname, filename); envfs_save(filename, dirname); } exit(0); |