From 3995287a4618b6bccc77c2b61d1ccc8716530da2 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 7 May 2017 19:08:43 +0000 Subject: [PATCH] list-cvs-files.sh: Add new features Add support for option -n (no submodules) Add support for project directory argument Signed-off-by: Jan Lindemann --- scripts/list-cvs-files.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/list-cvs-files.sh b/scripts/list-cvs-files.sh index 83c79869..eb929257 100644 --- a/scripts/list-cvs-files.sh +++ b/scripts/list-cvs-files.sh @@ -37,7 +37,7 @@ list_dirents_cvs() list_dirents_git() { git ls-files $1 - git submodule foreach 'git ls-files | sed "s|^|$path/|"' + [ "$opt_no_submodules" = 1 ] || git submodule foreach 'git ls-files | sed "s|^|$path/|"' } list_dirents() @@ -53,16 +53,23 @@ list_dirents() list_dirents_git $1 } -set -- `getopt f "$@"` +set -- `getopt fn "$@"` while [ "$1" != -- ]; do case $1 in -f) opt_only_regular_files=1 ;; +-n) + opt_no_submodules=1 + ;; esac shift done shift +proj_dir="$1" +[ "$proj_dir" ] && cd $proj_dir + list_dirents . | sort +