Skip to content

Commit a82a103

Browse files
committed
[css2] Added function to view one issue only
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%40191
1 parent bc19625 commit a82a103

2 files changed

Lines changed: 86 additions & 44 deletions

File tree

css2/bin/Attic/todo

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,28 @@ quick_help ()
5555
pr
5656
}
5757

58+
print_issue ()
59+
{
60+
pr "Number : $i"
61+
pr "Priority : $prio"
62+
pr "Description : $desc"
63+
pr "Reference : $ref"
64+
pr "Owner : $own"
65+
pr "Archived on : $date1"
66+
pr "Resolved on : $date2"
67+
pr "Comments : $comment"
68+
pr "Resolution : $res"
69+
pr
70+
}
71+
5872
list_issues ()
5973
{
6074
(
6175
IFS=' '
6276
i=0
6377
while read who prio desc ref own date1 date2 comment res; do
6478
i=`expr $i + 1`
65-
pr "Number : $i"
66-
pr "Priority : $prio"
67-
pr "Description : $desc"
68-
pr "Reference : $ref"
69-
pr "Owner : $own"
70-
pr "Archived on : $date1"
71-
pr "Resolved on : $date2"
72-
pr "Comments : $comment"
73-
pr "Resolution : $res"
74-
pr
79+
print_issue
7580
done
7681
) < $ISSUES
7782
}
@@ -83,22 +88,35 @@ list_unresolved ()
8388
i=0
8489
while read who prio desc ref own date1 date2 comment res; do
8590
i=`expr $i + 1`
86-
if [ "$res" = "-" ]; then
87-
pr "Number : $i"
88-
pr "Priority : $prio"
89-
pr "Description : $desc"
90-
pr "Reference : $ref"
91-
pr "Owner : $own"
92-
pr "Archived on : $date1"
93-
pr "Resolved on : $date2"
94-
pr "Comments : $comments"
95-
pr "Resolution : $res"
96-
pr
97-
fi
91+
if [ "$res" = "-" ]; then print_issue; fi
9892
done
9993
) < $ISSUES
10094
}
10195

96+
97+
list_issue ()
98+
{
99+
if [ -z "$num" ]; then
100+
pr "Number: \c"
101+
read num
102+
fi
103+
case "$num" in
104+
[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) ;;
105+
*) pr "Error: not a valid issue number: $num" >&2; return 2;;
106+
esac
107+
(
108+
IFS=' '
109+
i=0
110+
while read who prio desc ref own date1 date2 comment res1; do
111+
i=`expr $i + 1`
112+
if [ "$i" = "$num" ]; then
113+
print_issue
114+
exit 0
115+
fi
116+
done < $ISSUES
117+
)
118+
}
119+
102120
generate_html ()
103121
{
104122
echo "<table cellpadding=0 cellspacing=0 border=0>"
@@ -344,6 +362,7 @@ interactive ()
344362
pr "Choose one of:"
345363
while [ "$reply" = "" ]; do
346364
pr " l list the issues"
365+
pr " i list a specific issue"
347366
pr " t list only unresolved issues"
348367
pr " a add an issue"
349368
pr " c add a comment to an issue"
@@ -356,6 +375,7 @@ interactive ()
356375
read reply
357376
case "$reply" in
358377
l) list_issues | $PAGER;;
378+
i) list_issue ;;
359379
a) ref=; desc=; add_issue;;
360380
c) num=; comment=; add_comment;;
361381
o) num=; own=; add_owner;;
@@ -378,6 +398,7 @@ if [ $# = 0 ]; then
378398
else
379399
case "$1" in
380400
-l) list_issues;;
401+
-i) num=$2; shift 2; list_issue;;
381402
-a) ref=$2; shift 2; desc="$*"; add_issue;;
382403
-c) num=$2; shift 2; comment="$*"; add_comment;;
383404
-o) num=$2; shift 2; own="$*"; add_owner;;

css2/bin/todo

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,28 @@ quick_help ()
5555
pr
5656
}
5757

58+
print_issue ()
59+
{
60+
pr "Number : $i"
61+
pr "Priority : $prio"
62+
pr "Description : $desc"
63+
pr "Reference : $ref"
64+
pr "Owner : $own"
65+
pr "Archived on : $date1"
66+
pr "Resolved on : $date2"
67+
pr "Comments : $comment"
68+
pr "Resolution : $res"
69+
pr
70+
}
71+
5872
list_issues ()
5973
{
6074
(
6175
IFS=' '
6276
i=0
6377
while read who prio desc ref own date1 date2 comment res; do
6478
i=`expr $i + 1`
65-
pr "Number : $i"
66-
pr "Priority : $prio"
67-
pr "Description : $desc"
68-
pr "Reference : $ref"
69-
pr "Owner : $own"
70-
pr "Archived on : $date1"
71-
pr "Resolved on : $date2"
72-
pr "Comments : $comment"
73-
pr "Resolution : $res"
74-
pr
79+
print_issue
7580
done
7681
) < $ISSUES
7782
}
@@ -83,22 +88,35 @@ list_unresolved ()
8388
i=0
8489
while read who prio desc ref own date1 date2 comment res; do
8590
i=`expr $i + 1`
86-
if [ "$res" = "-" ]; then
87-
pr "Number : $i"
88-
pr "Priority : $prio"
89-
pr "Description : $desc"
90-
pr "Reference : $ref"
91-
pr "Owner : $own"
92-
pr "Archived on : $date1"
93-
pr "Resolved on : $date2"
94-
pr "Comments : $comments"
95-
pr "Resolution : $res"
96-
pr
97-
fi
91+
if [ "$res" = "-" ]; then print_issue; fi
9892
done
9993
) < $ISSUES
10094
}
10195

96+
97+
list_issue ()
98+
{
99+
if [ -z "$num" ]; then
100+
pr "Number: \c"
101+
read num
102+
fi
103+
case "$num" in
104+
[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]) ;;
105+
*) pr "Error: not a valid issue number: $num" >&2; return 2;;
106+
esac
107+
(
108+
IFS=' '
109+
i=0
110+
while read who prio desc ref own date1 date2 comment res1; do
111+
i=`expr $i + 1`
112+
if [ "$i" = "$num" ]; then
113+
print_issue
114+
exit 0
115+
fi
116+
done < $ISSUES
117+
)
118+
}
119+
102120
generate_html ()
103121
{
104122
echo "<table cellpadding=0 cellspacing=0 border=0>"
@@ -344,6 +362,7 @@ interactive ()
344362
pr "Choose one of:"
345363
while [ "$reply" = "" ]; do
346364
pr " l list the issues"
365+
pr " i list a specific issue"
347366
pr " t list only unresolved issues"
348367
pr " a add an issue"
349368
pr " c add a comment to an issue"
@@ -356,6 +375,7 @@ interactive ()
356375
read reply
357376
case "$reply" in
358377
l) list_issues | $PAGER;;
378+
i) list_issue ;;
359379
a) ref=; desc=; add_issue;;
360380
c) num=; comment=; add_comment;;
361381
o) num=; own=; add_owner;;
@@ -378,6 +398,7 @@ if [ $# = 0 ]; then
378398
else
379399
case "$1" in
380400
-l) list_issues;;
401+
-i) num=$2; shift 2; list_issue;;
381402
-a) ref=$2; shift 2; desc="$*"; add_issue;;
382403
-c) num=$2; shift 2; comment="$*"; add_comment;;
383404
-o) num=$2; shift 2; own="$*"; add_owner;;

0 commit comments

Comments
 (0)