add "position to the command line argurments and environment variables

This commit is contained in:
TravonteD 2019-10-14 08:27:37 -04:00
parent 81879cf9ed
commit eacde3a340
1 changed files with 6 additions and 1 deletions

7
kunst
View File

@ -32,7 +32,7 @@ show_help() {
# Parse the arguments
options=$(getopt -o h --long size:,music_dir:,version,silent,help -- "$@")
options=$(getopt -o h --long position:,size:,music_dir:,version,silent,help -- "$@")
eval set -- "$options"
while true; do
@ -41,6 +41,10 @@ while true; do
shift;
SIZE=$1
;;
--position)
shift;
POSITION=$1
;;
--music_dir)
shift;
MUSIC_DIR=$1
@ -183,6 +187,7 @@ main() {
[[ $KUNST_MUSIC_DIR != "" ]] && MUSIC_DIR=$KUNST_MUSIC_DIR
[[ $KUNST_SIZE != "" ]] && SIZE=$KUNST_SIZE
[[ $KUNST_POSITION != "" ]] && POSITION=$KUNST_POSITION
# Flag to run some commands only once in the loop
FIRST_RUN=true