From 798ffbd7ac930c18ef98ef22932cf3285e9982cc Mon Sep 17 00:00:00 2001 From: mintycube <90507714+osama-aslam@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:35:54 +0500 Subject: [PATCH] added -v option to list created files --- README.md | 2 ++ ff | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af86279..229391b 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ ff is a bash script which is a combination of 'mkdir' and 'touch'. It can create ```bash ff [path file or folder] + --help : prints usage info + -v : prints created files ``` ## Examples diff --git a/ff b/ff index cd7b186..35585c3 100755 --- a/ff +++ b/ff @@ -4,7 +4,10 @@ # █▀▀ ▄▀█ █▀ ▀█▀ █▀▀ █ █ █▀▀ █▀ # █▀ █▀█ ▄█ █ █▀ █ █▄▄ ██▄ ▄█ # -# Usage: ff [path file or folder] +# Usage: ff [option] [path file or folder] +# +# --help : prints usage info +# -v : prints created files # # Description: Bash script which is a combination of 'mkdir' and 'touch'. # It can create directory structures and files simultaneously @@ -98,7 +101,7 @@ fi createObjects "$@" -# Only print created files if executing directly from the command line. -if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then +# Only print created files if "-v" (verbose) is the first argument +if [[ "$1" == "-v" ]]; then listObjects "$@" fi