-
Notifications
You must be signed in to change notification settings - Fork 3
/
RENAME
60 lines (60 loc) · 1.08 KB
/
RENAME
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
*
GIT.FILENAME = 'RENAME'
GIT.REPO = 'https://github.com/Krowemoh/TCL-Utilities.git'
*
* VERSION
*
VERSION = '1'
*
@USER1 = 'RENAME'
@USER2 = 'RENAME'
*
EQU TRUE TO 1
EQU FALSE TO 0
*
CALL GET.ARGUMENTS(ARGS)
DELETE.FLAG = TRUE
*
ARGS.LEN = DCOUNT(ARGS,@AM)
*
IF ARGS.LEN = 1 THEN
PRINT 'RENAME - Rename Command'
PRINT
PRINT ' RENAME [DICT] {FILE} {CURRENT.NAME} {NEW.NAME}'
PRINT
STOP
*
END ELSE IF ARGS.LEN # 4 AND ARGS.LEN # 5 THEN
PRINT 'Invalid option.'
STOP
END
*
IF ARGS<2> = 'DICT' THEN
FILE = ARGS<3>
CURRENT.NAME = ARGS<4>
NEW.NAME = ARGS<5>
*
ARGS = INSERT(ARGS,5;'DICT')
ARGS = INSERT(ARGS,6;FILE)
*
END ELSE
FILE = ARGS<2>
CURRENT.NAME = ARGS<3>
NEW.NAME = ARGS<4>
*
ARGS = INSERT(ARGS,4;FILE)
END
*
IF CURRENT.NAME = NEW.NAME THEN
PRINT 'Cannot rename to the same name.'
STOP
END
*
CLEARSELECT
*
CALL MOVE.FILES(ARGS,DELETE.FLAG)
*
* END OF PROGRAM
*
END
*