File: string-mode

package info (click to toggle)
acr 2.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: sh: 4,738; makefile: 41
file content (28 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
string-mode
===========

ACR 0.5 adds an internal infrastructure to parse strings to make code cleaner
to read and maintain. BTW it allows to keep a centralized form to debug and
handle strings inside the ACR engine (acr-sh).

String mode implements 3 functions:

 - enter_string_mode
 - wait_string_mode
 - leave_string_mode

The way to use them is:

(...)
case "${MODE}" in
"mode-name")
	enter_string_mode "${STR}"
	wait_string_mode

	# do whatever i want with the string
	echo "My string is: ${STRING}" >&2

	leave_string_mode
;;
(...)
esac