summaryrefslogtreecommitdiff
path: root/vc
diff options
context:
space:
mode:
authorMichal Vyskocil <mvyskocil@suse.cz>2009-04-22 14:44:17 +0000
committerMichal Vyskocil <mvyskocil@suse.cz>2009-04-22 14:44:17 +0000
commit114f3a32887a9c1f4f61eb233864bffcb77cb0c6 (patch)
tree83d2d0609aa153e7c7746a4ec283fb2ed6946079 /vc
parented25745e13e41896233e455e4c27ed925a1b5f55 (diff)
just edit option for buildvc and osc vc commands, used /usr/lib/build/vc in osc vc
Diffstat (limited to 'vc')
-rwxr-xr-xvc32
1 files changed, 26 insertions, 6 deletions
diff --git a/vc b/vc
index 45db3e9..363646e 100755
--- a/vc
+++ b/vc
@@ -39,13 +39,29 @@ fi
while [ -n "$1" ]; do
case "$1" in
-m)
+ if [ $just_edit ]; then
+ echo "You cannot use -m and -e together!"
+ exit 1
+ fi
message="$2"
shift 2
;;
+ -e)
+ if [ -n "${message}" ]; then
+ echo "You cannot use -m and -e together!"
+ exit 1
+ fi
+ just_edit=true
+ shift 1
+ ;;
--help)
- echo "Usage: $0 [filename[.changes]|path [file_with_comment]]"
+ echo "Usage: $0 [-m MESSAGE|-e] [filename[.changes]|path [file_with_comment]]"
echo
echo "Will use '$mailaddr' for changelog entries"
+ echo
+ echo "Options:"
+ echo " -m MESSAGE add MESSAGE to changes (not open an editor)"
+ echo " -e just open changes (cannot be used with -m)"
exit 0
;;
*) break ;;
@@ -103,17 +119,21 @@ trap "rm -f \"$tmpfile\"" EXIT
set +e
{
- echo "-------------------------------------------------------------------"
- echo "$date - $mailaddr"
- echo
+ if [ ! $just_edit ]; then
+ echo "-------------------------------------------------------------------"
+ echo "$date - $mailaddr"
+ echo
+ fi
if [ -n "$message" ]; then
echo "- $message"
+ echo
elif [ -n "$content" ]; then
cat "$content"
- else
+ echo
+ elif [ ! $just_edit ]; then
echo "- "
+ echo
fi
- echo
cat $changelog
} >> "$tmpfile"