diff options
| author | Joseph Richey <joerichey@google.com> | 2017-07-18 10:59:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-18 10:59:40 -0700 |
| commit | 8867856db45abaed8b9e2539ee7c34d99360db56 (patch) | |
| tree | 5895bce36a9dff465057d84819b0d65255e1c702 /input_fail.py | |
| parent | 3d08d9f6891db3ca94337e9b987ef62cba535fe1 (diff) | |
| parent | 17f7dd867d0fd450377c6862c0782483d39ae408 (diff) | |
Merge pull request #22 from google/fix
Fixing fscrypt build system
Diffstat (limited to 'input_fail.py')
| -rwxr-xr-x | input_fail.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/input_fail.py b/input_fail.py new file mode 100755 index 0000000..4b7e802 --- /dev/null +++ b/input_fail.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +# Exit with 1 if any input is provided. Print the input to stdout, unless an +# argument is specified. In that case, also print the argument. + +import sys + +input_string = sys.stdin.read() +if input_string != "": + sys.stdout.write(input_string) + if len(sys.argv) >= 2: + print(sys.argv[1]) + sys.exit(1) |