diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-01-30 20:38:13 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-01-30 20:38:13 +0530 |
commit | 0fb49390dfd8242eae32c3db1970d30173c4bc4d (patch) | |
tree | c5aae5a92579358283a76786c2989d714f1ebc7c /scripts/natool | |
parent | cad067a2114d48446f08898fc6b566ecbc6176f6 (diff) | |
download | nnn-0fb49390dfd8242eae32c3db1970d30173c4bc4d.tar.gz |
natool: support multiple args
Diffstat (limited to 'scripts/natool')
-rwxr-xr-x | scripts/natool/natool | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/natool/natool b/scripts/natool/natool index 65e0be5..168a22d 100755 --- a/scripts/natool/natool +++ b/scripts/natool/natool @@ -23,16 +23,18 @@ import sys from subprocess import Popen, PIPE, DEVNULL -if len(sys.argv) != 3: +if len(sys.argv) < 3: print('usage: natool [-l] [-x] [archive] [file/dir]') sys.exit(0) if sys.argv[1] == '-x': - cmd = ['patool', '--non-interactive', 'extract', sys.argv[2]] + cmd = ['patool', '--non-interactive', 'extract'] elif sys.argv[1] == '-l': - cmd = ['patool', '--non-interactive', 'list', sys.argv[2]] + cmd = ['patool', '--non-interactive', 'list'] else: - cmd = ['patool', '--non-interactive', 'create', sys.argv[1], sys.argv[2]] + cmd = ['patool', '--non-interactive', 'create', sys.argv[1]] + +cmd.extend(sys.argv[2:]) pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) out, err = pipe.communicate() |