From 376d186b2e8b3fbff46464ef51bc7e035f7db7e9 Mon Sep 17 00:00:00 2001 From: Thomas Orozco Date: Tue, 1 Sep 2015 21:09:05 +0200 Subject: [PATCH] Set default verbosity level to 1 This means warnings always show warnings, which is the right thing to do considering the 2 warnings we show are actually for important information. --- README.md | 5 ++--- ci/run_build.sh | 4 ++-- src/tini.c | 4 ++-- test/run_outer_tests.py | 2 +- tpl/README.md.in | 5 ++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7e52bd8..f18dd22 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ looks like `tini: invalid option -- 'c'`, then you *need* to add the `--`. Arguments Tini itself are passed like so: `/tini -v -- /your/program`. The only supported argument at this time is `-v`, for extra verbosity (you can -pass it up to 4 times, e.g. `-vvvv`). +pass it up to 3 times, e.g. `-vvv`). *NOTE: The binary linked above is a 64-bit dynamically-linked binary.* @@ -103,12 +103,11 @@ Debugging --------- If something isn't working just like you expect, consider increasing the -verbosity level (up to 4): +verbosity level (up to 3): tini -v -- bash -c 'exit 1' tini -vv -- true tini -vvv -- pwd - tini -vvvv -- ls [10]: https://github.com/krallin/tini-images diff --git a/ci/run_build.sh b/ci/run_build.sh index a93ed68..ba2ba2d 100755 --- a/ci/run_build.sh +++ b/ci/run_build.sh @@ -39,10 +39,10 @@ popd # Smoke tests (actual tests need Docker to run; they don't run within the CI environment) for tini in "${BUILD_DIR}/tini" "${BUILD_DIR}/tini-static"; do echo "Testing $tini with: true" - $tini -vvvv true + $tini -vvv true echo "Testing $tini with: false" - if $tini -vvvv false; then + if $tini -vvv false; then exit 1 fi diff --git a/src/tini.c b/src/tini.c index 0d2e99e..3063e6a 100644 --- a/src/tini.c +++ b/src/tini.c @@ -37,7 +37,7 @@ #if HAS_SUBREAPER static int subreaper = 0; #endif -static int verbosity = 0; +static int verbosity = 1; static struct timespec ts = { .tv_sec = 1, .tv_nsec = 0 }; @@ -74,7 +74,7 @@ void print_usage(char* const name, FILE* const file) { #if HAS_SUBREAPER fprintf(file, " -s: Register as a process subreaper (requires Linux >= 3.4).\n"); #endif - fprintf(file, " -v: Generate more verbose output. Repeat up to 4 times.\n"); + fprintf(file, " -v: Generate more verbose output. Repeat up to 3 times.\n"); fprintf(file, "\n"); } diff --git a/test/run_outer_tests.py b/test/run_outer_tests.py index b161dad..924189e 100755 --- a/test/run_outer_tests.py +++ b/test/run_outer_tests.py @@ -77,7 +77,7 @@ if __name__ == "__main__": functional_base_cmd = base_cmd + [ "--entrypoint={0}".format(entrypoint), img, - "-vvvv", + "-vvv", ] # Reaping test diff --git a/tpl/README.md.in b/tpl/README.md.in index 547bfac..57779cc 100644 --- a/tpl/README.md.in +++ b/tpl/README.md.in @@ -49,7 +49,7 @@ looks like `tini: invalid option -- 'c'`, then you *need* to add the `--`. Arguments Tini itself are passed like so: `/tini -v -- /your/program`. The only supported argument at this time is `-v`, for extra verbosity (you can -pass it up to 4 times, e.g. `-vvvv`). +pass it up to 3 times, e.g. `-vvv`). *NOTE: The binary linked above is a 64-bit dynamically-linked binary.* @@ -103,12 +103,11 @@ Debugging --------- If something isn't working just like you expect, consider increasing the -verbosity level (up to 4): +verbosity level (up to 3): tini -v -- bash -c 'exit 1' tini -vv -- true tini -vvv -- pwd - tini -vvvv -- ls [10]: https://github.com/krallin/tini-images