-
Notifications
You must be signed in to change notification settings - Fork 3
/
ADD-PATH
71 lines (71 loc) · 1.34 KB
/
ADD-PATH
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
*
GIT.FILENAME = 'ADD-PATH'
GIT.REPO = 'https://github.com/Krowemoh/TCL-Utilities.git'
*
* VERSION
*
VERSION = '1'
*
@USER1 = 'ADD-PATH'
@USER2 = 'ADD-PATH'
*
EQU TRUE TO 1
EQU FALSE TO 0
*
OPEN '','VOC' TO VOC.FILE ELSE
PRINT 'Unable to open file: VOC-FILE'
STOP
END
*
CALL GET.ARGUMENTS(ARGS)
*
ARGS.LEN = DCOUNT(ARGS,@AM)
*
IF ARGS.LEN = 1 THEN
PRINT 'ADD-PATH - Add a F Pointer to a Linux Path'
PRINT
PRINT ' ADD-PATH {MD.NAME} {/path/to/folder}'
PRINT
STOP
*
END ELSE IF ARGS.LEN # 3 THEN
PRINT 'Invalid option'
STOP
END
*
MD.ID = ARGS<2>
FILE.PATH = ARGS<3>
*
IF FILE.PATH[LEN(FILE.PATH),1] # '/' THEN
PRINT 'FILE.PATH should end with /'
STOP
END
*
OPENPATH FILE.PATH TO FILE ELSE
PRINT 'Path does not exist: ' : FILE.PATH
STOP
END
*
READ VOC.ITEM FROM VOC.FILE,MD.ID THEN
PRINT 'VOC entry exists, overwrite? (y/N) ' :
INPUT ANS
*
IF ANS # 'Y' THEN
PRINT 'No changes made.'
STOP
END
END
*
VOC.ITEM = ''
VOC.ITEM<1> = 'F'
VOC.ITEM<2> = FILE.PATH
VOC.ITEM<3> = FILE.PATH
*
WRITE VOC.ITEM ON VOC.FILE,MD.ID
*
PRINT 'Updated VOC with ' : MD.ID : ' -> ' : FILE.PATH
*
* END OF PROGRAM
*
END
*