From e7ece8748b1584aa359e69643ff34e21831ae848 Mon Sep 17 00:00:00 2001 From: Jakub Fojt Date: Wed, 16 Mar 2022 15:47:09 +0100 Subject: [PATCH] Enchance npz_preview --- .bashrc.kuba | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.bashrc.kuba b/.bashrc.kuba index 9ea484f..1d73bb7 100755 --- a/.bashrc.kuba +++ b/.bashrc.kuba @@ -55,8 +55,10 @@ class Wrap: setattr(self, f, n[f]) globs[f] = n[f] -archive = Wrap(argv[1]) -print('Global namespace populated with "archive" and all files') +argv = argv[argv.index('--')+1:] +archives = [Wrap(arg) for arg in argv[::-1]] +archive = archives[0] +print('Global namespace populated with "archive", "archives" and all files') EOM )" @@ -66,7 +68,16 @@ npz_preview() { return fi - python -ic "$npz_py_str" "$1" + python -ic "$npz_py_str" -- "$@" +} + +npz_previewi() { + if [ $# -lt 1 ]; then + echo "Please specify file to open as argument" + return + fi + + ipython -i -c "$npz_py_str" -- "$@" } rsync_wrap() {