Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
smartcd: use --version option to print version info & `SMARTCD_VERS…
Browse files Browse the repository at this point in the history
…ION_OPT` to customize the option
  • Loading branch information
CodesOfRishi committed Dec 16, 2021
1 parent 1da584a commit eea8911
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions smartcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ __smartcd__() {

# no. of unique recently visited directories smartcd to remember
export SMARTCD_HIST_SIZE=${SMARTCD_HIST_SIZE:-"50"}
export SMARTCD_VERSION="v1.3.0"

# options customizations
export SMARTCD_CLEANUP_OPT=${SMARTCD_CLEANUP_OPT:-"--cleanup"} # option for cleanup of log file
export SMARTCD_PARENT_DIR_OPT=${SMARTCD_PARENT_DIR_OPT:-".."} # option for searching & traversing to parent-directories
export SMARTCD_HIST_OPT=${SMARTCD_HIST_OPT:-"--"} # option for searching & traversing to recently visited directories
export SMARTCD_GIT_ROOT_OPT=${SMARTCD_GIT_ROOT_OPT:-"."} # option for traversing to root of the git repo
export SMARTCD_VERSION_OPT=${SMARTCD_VERSION_OPT:-"--version"} # option for printing version information

# log files
local recent_dir_log="${SMARTCD_CONFIG_DIR}/smartcd_recent_dir.log" # stores last 50 unique visited absolute paths
Expand Down Expand Up @@ -156,6 +158,10 @@ __smartcd__() {
goto_git_repo_root
elif [[ $1 == "${SMARTCD_CLEANUP_OPT}" ]]; then
cleanup_log
elif [[ $1 == "${SMARTCD_VERSION_OPT}" ]]; then
echo "SmartCd by Rishi K. - ${SMARTCD_VERSION}"
echo "The MIT License (MIT)"
echo "Copyright (c) 2021 Rishi K."
else
sub_dir_hop $@
fi
Expand Down

0 comments on commit eea8911

Please sign in to comment.