New commits:
commit da92703b2c66561d98bba1af7124c8ef091bda79
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* quill: improved the parameter parsing and added two shortcuts
(getopts?)
removed redundant message, codex_does_spell_exsist prints its own
* libcore: added check_parameter to check for missing parameters
added shorthand combo examples to quill_help
fixed quill_purge move syntax error
* libhistory: don't use hardcoded tabs, so the function is easier to
reuse
# we should do some quillrc sanity checking someday
[[ ! -d $QUILL_SPELL_DIR ]] &&
- echo "PEBKAC: bad QUILL_SPELL_DIR ($QUILL_SPELL_DIR)" &&
+ echo "Bad QUILL_SPELL_DIR ($QUILL_SPELL_DIR)!" &&
echo "Try running quill -r" &&
exit 7
@@ -129,11 +139,8 @@ fi
if [[ "$QUILL_UPDATE" == "on" ]]
then
SPELL_NAME=$QUILL_TARGET
- if ! codex_does_spell_exist $SPELL_NAME
- then
- message "${PROBLEM_COLOR}$SPELL_NAME is not a spell!$DEFAULT_COLOR"
- exit 6
- fi
+ codex_does_spell_exist $SPELL_NAME || exit 6
+
while true; do
actions=('Update the spell to a newer version' \
'Manage patches' \
@@ -144,7 +151,7 @@ then
'Try it out' \
'Quit' )
echo
- query_list "What do you want to do?" ANSWER "${actions[6]}"
"${actions[@]}"
+ query_list "What do you want to do?" ANSWER "Quit" "${actions[@]}"
[[ $ANSWER == "Quit" ]] && exit 0
@@ -225,6 +232,7 @@ then
get_sources_and_urls
echo
+ message "Summoning ..."
#download; we are not a grimoire so some hacking is needed
# also workaround sorcery bug #13412
to_summon="$sources_and_urls"
diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 287a514..43dbb53 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-20 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * quill: improved the parameter parsing and added two shortcuts
(getopts?)
+ removed redundant message, codex_does_spell_exsist prints its own
+ * libcore: added check_parameter to check for missing parameters
+ added shorthand combo examples to quill_help
+ fixed quill_purge move syntax error
+ * libhistory: don't use hardcoded tabs, so the function is easier to
reuse
+
2007-01-18 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* quill: moved purging to libcore
* libcore: made quill_purge run a safe quill_rc
diff --git a/var/lib/quill/modules/libcore b/var/lib/quill/modules/libcore
index 00cf977..1acd00a 100644
--- a/var/lib/quill/modules/libcore
+++ b/var/lib/quill/modules/libcore
@@ -244,7 +244,7 @@ function quill_purge() {
else
message "${PROBLEM_COLOR}failed!$DEFAULT_COLOR"
fi
- exit $rc ;;
+ exit $rc
}
#---
@@ -263,7 +263,6 @@ function dump_default_function() {
#---
function quill_version() {
-
message "quill - $QUILL_VERSION
Copyright (C) 2006 Source Mage
This is free software. You may redistribute copies of it under the terms of
@@ -284,13 +283,22 @@ Arjan 'abouter' Bouter
exit 0
}
+#---
+## @Synopsis checks if the parameter is missing
+## @Synopsis if not, saves it in QUILL_TARGET
+#---
+function check_parameter() {
+ [[ -z $1 ]] &&
+ message "${PROBLEM_COLOR}Missing parameter$DEFAULT_COLOR" &&
+ quill_help 101 ||
+ QUILL_TARGET="$1"
+}
#---
## @Synopsis function that displays help and exits
#---
function quill_help() {
-
message "quill -$QUILL_VERSION
Copyright (C) 2006 Source Mage
This is free software. You may redistribute copies of it under the terms of
@@ -318,6 +326,9 @@ EXAMPLES:
Update a spell; try to get some information from Perl-CPAN:
quill -c wormux -u wormux
+
+ The same can be done with shorter forms (fu, uf, cu and uc are supported):
+ quill -cu wormux
"
exit ${1:-0}
}
diff --git a/var/lib/quill/modules/libhistory
b/var/lib/quill/modules/libhistory
index b8c3e46..f6b98fc 100644
--- a/var/lib/quill/modules/libhistory
+++ b/var/lib/quill/modules/libhistory
@@ -24,9 +24,9 @@ function add_history_entry()
if grep -q "$title" HISTORY;
then
- sed -i "/$title/ a\ * $1" HISTORY
+ sed -i "/$title/ a\\\t* $1" HISTORY
else # first time
- sed -i "1 s/^.*$/$title\n * $1\n\n&/" HISTORY
+ sed -i "1 s/^.*$/$title\n\t* $1\n\n&/" HISTORY
fi
}
[SM-Commit] GIT changes to master quill by Jaka Kranjc (da92703b2c66561d98bba1af7124c8ef091bda79),
Jaka Kranjc, 01/20/2007