-
Notifications
You must be signed in to change notification settings - Fork 0
/
converter.sh
51 lines (43 loc) · 1.21 KB
/
converter.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
############################################################
# Help #
############################################################
Help()
{
# Display Help
echo "Converter.sh"
echo "Usage: $0 -p file_path -n file_name -o output_name"
echo -e "\t-p Path of the .xlsx file you want to convert"
echo -e "\t-n Name of the .xlsx file you want to convert"
echo -e "\t-o Output Name of the .xlsx file you want to convert"
echo
}
############################################################
# MAIN #
############################################################
# Get the options
while getopts ":p:n:o:" o; do
case "${o}" in
p)
path=${OPTARG}
;;
n)
name=${OPTARG}
;;
o)
outputName=${OPTARG}
;;
*)
Help
exit;;
esac
done
shift $((OPTIND-1))
# Print Help in case parameters are empty
if [ -z "$path" ] || [ -z "$name" ] || [ -z "$outputName" ]
then
echo "Some or all of the parameters are empty";
Help
fi
# Begin the script
python3 main.py $path $name $outputName