Skip to content
Snippets Groups Projects
xper.sh 1.53 KiB
#!/bin/zsh

if [ $# -eq 0 ]; then
	printf "usage: xper [init|new|lore|loit|origin]
\tinit    - to initialize the experiment directory (run first)
\tnew     - to create an empty experiment subdirectory
\tlore    - to run major modification of the current experiment in a sibling subdirectory
\tloit    - to run minor modification of the current experiment in a child subdirectory
\torigin  - to go to the leaf subdirectory */001 of the current experiment directory

example 1: expr new -m 'from MLP-AE to CNN-AE'
example 2: expr ext -m '5x more parametrized AE'

usage: xper tree [|<path>]
usage: xper new --at-depth <d>
\t --at-depth <d> - to run major modification of the current expriment in a sibling subdirectory created at depth absolute <d> or relative depth <-d> or <+d>
\n"
	exit
fi

. init.sh    --import
. new.sh     --import
. lore.sh    --import
. loit.sh    --import
. tree.sh    --import

CMD=$1
shift

ARGS=()
TAG=""
TAGGED_PATH=""
CURR_DIR=$(pwd)
# DIR_PATH=""

while [[ $# -gt 0 ]]; do
	case $1 in
		-t|--tag)
			TAG="$2"
			shift
			shift
			;;
		-T|--Tag)
			TAGGED_PATH="$2"
			shift
			shift
			;;
		*)
			ARGS+=("$1")
			shift
			;;
	esac
done

main(){
	if [ $CMD = "init" ]; then
		init $TAG
	elif [ $CMD = "new" ]; then
		new $ARGS
	elif [ $CMD = "lore" ]; then
		lore $TAGGED_PATH $ARGS
	elif [ $CMD = "loit" ]; then
		loit $TAG $ARGS
	elif [ $CMD = "tree" ]; then
		tree $ARGS
	elif [ $CMD = "search" ]; then
		echo search
	elif [ $CMD = "run" ]; then
		echo run
	elif [ $CMD = "set" ]; then
		echo set
	else
		echo hi there
	fi
};

main $@