Skip to content

Commit

Permalink
release version 0.1.2: fixed help and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
inutano committed Jun 7, 2017
1 parent ead8a73 commit 86ec3e5
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions bin/pfastq-dump
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,37 @@
set -e

# pfastq-dump version
VERSION="0.1.0"
VERSION="0.1.2"

# default arguments
TMPDIR="$( cd $( dirname ${BASH_SOURCE[0]} ) && pwd )"
OUTDIR="${TMPDIR}"
NTHREADS=1

# functions for version and help
print_version(){
echo "pfastq-dump version $VERSION using fastq-dump " `fastq-dump --version | awk '$1 ~ /^fastq/ { print $3 }'`
}

print_help(){
cat <<EOS
Usage:
pfastq-dump --threads <number of threads> [options] <path> [<path>...]
pfastq-dump option:
-t|--threads number of threads
-s|--sra-id SRA id
-O|--outdir output directory
--tmpdir temporary directory
Extra arguments will be passed through
Other:
-v|--version show version info
-h|--help program usage
EOS
}

# parse arguments
while [[ $# -gt 0 ]]; do
key=${1}
Expand Down Expand Up @@ -52,29 +76,6 @@ while [[ $# -gt 0 ]]; do
shift
done

print_version(){
echo "pfastq-dump version $VERSION using fastq-dump " `fastq-dump --version | awk '$1 ~ /^fastq/ { print $3 }'`
}

print_help(){
cat <<EOS
Usage:
pfastq-dump --threads <number of threads> [options] <path> [<path>...]
pfastq-dump option:
-t|--threads number of threads
-s|--sra-id SRA id
-O|--outdir output directory
--tmpdir temporary directory
Extra arguments will be passed through
Other:
-v|--version show version info
-h|--help program usage
EOS
}

# function to exec multiple fastq dump
parallel_fastq_dump(){
local sra="${1}"
Expand Down Expand Up @@ -162,10 +163,10 @@ check_binary_location(){
local cmd="${1}"
local cmd_path=`which ${cmd} 2>/dev/null ||:`
if [[ ! -e "${cmd_path}" ]]; then
echo "${cmd} not found." >&2
echo "ERROR: ${cmd} not found." >&2
exit 1
else
echo "Using $(${cmd} --version)" >&2
echo "Using $(${cmd} --version | tr -d '\n')" >&2
fi
}

Expand Down

0 comments on commit 86ec3e5

Please sign in to comment.