implement -c

This commit is contained in:
Vincent Riquer 2013-04-08 02:57:10 +02:00
parent 1a9758a251
commit 37df18f45d
3 changed files with 8 additions and 5 deletions

8
atom
View File

@ -43,6 +43,8 @@ declare -r \
\ \
oldIFS="$IFS" oldIFS="$IFS"
cffile="$HOME/.atom/atom.cfg"
LC_ALL=C LC_ALL=C
shopt -s extglob shopt -s extglob
@ -96,16 +98,16 @@ done
#FIXME: check sanity #FIXME: check sanity
if [ ! -f ~/.atom/atom.cfg ] if [ ! -f "$cffile" ]
then then
if [ ! -d ~/.atom ] if [ ! -d ~/.atom ]
then then
mkdir -p ~/.atom mkdir -p ~/.atom
fi fi
sed "s:%HOME%:$HOME:" "$exampleconf" > ~/.atom/atom.cfg sed "s:%HOME%:$HOME:" "$exampleconf" > "$cffile"
cat >&2 <<-EOCfgNotice cat >&2 <<-EOCfgNotice
No configuration file found! No configuration file found!
An example file has been created as ~/.atom/atom.cfg. An example file has been created as "${cffile/$HOME/~}".
You should change it to your likings using you favorite editor. You should change it to your likings using you favorite editor.
Bailing out. Bailing out.

View File

@ -24,5 +24,5 @@ getConfig() {
getConfig$context getConfig$context
;; ;;
esac esac
done < ~/.atom/atom.cfg done < "$cffile"
} }

View File

@ -2,7 +2,8 @@
printConfig() { printConfig() {
{ {
cat <<-EOF cat <<-EOF
General|Load|$maxload General|Config file|$cffile
|Load|$maxload
|Load Interval|$loadinterval |Load Interval|$loadinterval
|Temp Dir|$tempdir |Temp Dir|$tempdir
|Database|$database |Database|$database