aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChiron Horwood2025-04-15 14:58:14 +0100
committerChiron Horwood2025-04-15 14:58:14 +0100
commit97588d37bd8291cec9640689eeb4bd3e53913d25 (patch)
treea5ca80d4753d1e8cf1de9715659409886c3e46e2
parentdd88450fd73f7111b9f7ea6990596bc0b40d7200 (diff)
downloadaur-97588d37bd8291cec9640689eeb4bd3e53913d25.tar.gz
Add -p flag
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--README.md5
-rwxr-xr-xwritedoc14
4 files changed, 21 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6e7d5fe70e64..55621185166a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
diff --git a/PKGBUILD b/PKGBUILD
index f7a61ba703a9..c40b91809493 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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
diff --git a/writedoc b/writedoc
index 9c54f7523694..d96a904d8280 100755
--- a/writedoc
+++ b/writedoc
@@ -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