#!/bin/sh

### Copyright notice at the bottom of this file ###

# $Id: simplePath,v 1.9 2012/01/08 19:27:21 adamm Exp adamm $
#
# $Source: /home/adamm/src/simplePath/RCS/simplePath,v $


main() {
    # Special handling for --help, --man
    if [ "x$1" == "x--man" ] || [ "x$1" == "x--help" ] ; then
	manpage
	exit 0
    fi

    # Change "before" to "after" to put personal directories at the end
    MINE=before

    # Uncomment the next line to use my "multi-architecture" scheme
    # MULTIARCH=1

    mine="$HOME/bin"

    system="/usr/local/bin"
    system="${system}:/usr/bin"
    system="${system}:/bin"

    if [ "$MULTIARCH" ] ; then
	archProg=$HOME/bin/archPath
	if [ -x $archProg ] ; then
	    mine="${mine}:`$archProg`/bin"
	fi
    fi

    if [ $MINE == "before" ] ; then
	echo "${mine}:${system}"
    else
	echo "${system}:${mine}"
    fi
} # main


manpage() {
    cat - <<__EOF
NAME
    simplePath -- print a PATH string

SYNOPSIS
    simplePath

DESCRIPTION
    simplePath prints a PATH string.

OPTIONS
    None.

AUTHOR
    Adam Moskowitz <adamm@menlo.com>
__EOF
} # manpage


main "$@"


###
### Copyright, 2010 - 2012, Adam Moskowitz. All rights reserved.
###
### Any redistribution of this software must retain the above copyright
### notice, this list of conditions, and the following disclaimer.
###
### Without specific prior written permission from the copyright holder,
### you may not charge a fee for the redistribution of this software.
###
### All other redistribution and use is hereby permitted.
###
### This software is provided "as is" and without any express or implied
### warranties, including, without limitation, the implied warranties of
### merchantability and fitness for a particular purpose.
###
