diff options
author | Chiron Horwood | 2025-04-15 14:58:14 +0100 |
---|---|---|
committer | Chiron Horwood | 2025-04-15 14:58:14 +0100 |
commit | 97588d37bd8291cec9640689eeb4bd3e53913d25 (patch) | |
tree | a5ca80d4753d1e8cf1de9715659409886c3e46e2 | |
parent | dd88450fd73f7111b9f7ea6990596bc0b40d7200 (diff) | |
download | aur-97588d37bd8291cec9640689eeb4bd3e53913d25.tar.gz |
Add -p flag
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | writedoc | 14 |
4 files changed, 21 insertions, 6 deletions
@@ -1,7 +1,7 @@ pkgbase = writedoc pkgdesc = A fast way of creating and editing notes using neovim without defining a file path - pkgver = 1.1.3 - pkgrel = 4 + pkgver = 1.1.4 + pkgrel = 1 url = https://github.com/Chiron8/writedoc arch = any license = MIT @@ -2,8 +2,8 @@ # This is my first package!!!! pkgname=writedoc -pkgver=1.1.3 -pkgrel=4 +pkgver=1.1.4 +pkgrel=1 pkgdesc="A fast way of creating and editing notes using neovim without defining a file path" arch=('any') url="https://github.com/Chiron8/writedoc" diff --git a/README.md b/README.md index db8ebedec34d..9385262ad322 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ The current options are: FILENAME is not required when using this flag - -r Reset all values back to their defaults FILENAME is not required when using this flag +- -p Use the default directory PLUS another folder The default value for the directory is `./Documents/` The default value for the file type is `.md` @@ -33,6 +34,10 @@ If I wanted to reset the default values, the resulting command would be: `writedoc -r` +If I wanted to created a file called `work` in the default directory plus a folder called `Important` (i.e the directory would be `~/DEFAULT/Important/`), the resulting command would be: + +`writedoc -p Important work` + ## Installation ### Automatic Install @@ -10,6 +10,9 @@ Usage: writedoc [options] FILENAME -c Change the default values of directory and/or file type use with either -d or -t to change the defaults FILENAME is not required and will be ignored + -p Use another folder in the default directory + e.g. writedoc -p ExampleFolder ExampleFile = + ~/Default/ExampleFolder/ExampleFile.md -r Reset all values back to the default setting @@ -22,9 +25,12 @@ EOF exit 1 } +CHANGE=0 +PFLAG=0 + # Get directory and file type DATA_DIR="/usr/share/writedoc" -CHANGE=0 + dirInput="$DATA_DIR/directory.txt" @@ -40,11 +46,15 @@ do done < "$ftInput" # Parse flags with getopts -while getopts ":crd:t:" OPTION; do +while getopts ":cp:rd:t:" OPTION; do case "$OPTION" in c) # Change defaults flag CHANGE=1 ;; + p) # + Folder + PFLAG=1 + DIRECTORY="$DIRECTORY/$OPTARG" + ;; r) # Reset defaults echo "./Documents/" > directory.txt echo ".md" > ft.txt |