Skip to content

Commit 2ca98d7

Browse files
committed
quiet got retired, verbose and batch introduced
1 parent 22e1ecd commit 2ca98d7

File tree

123 files changed

+1278
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1278
-508
lines changed

APLSource/Cider/AddAlias.aplf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
⍝ * If the alias is already defined with a different folder the user is asked to confirm overwriting it
66
⍝ * If the alias is undefined yet it as added
77
⍝ * You cannot delete an alias with this function.
8-
:Access Public Shared
98
r←⍬
109
ciderAliasFilename←GetCiderAliasFilename
1110
msg←''
@@ -15,7 +14,7 @@
1514
:If F.Exists ciderAliasFilename
1615
data←⊃F.NGET ciderAliasFilename 1
1716
:If ~F.Exists folder
18-
1 p Frame'Could not find "',folder,'"'
17+
(1 parms.batch)p'Could not find "',folder,'"'
1918
:ElseIf 0=+/(alias,'=')∘{⍺≡(≢⍺)↑⍵}¨data
2019
ind←({⍵↓⍨⍵⍳'='}¨data)⍳⊂folder
2120
:If ind≤≢data
@@ -42,7 +41,7 @@
4241
data←⊃¨{⍺,'=',⍵}/¨↓data
4342
(⊂data)F.NPUT ciderAliasFilename 1
4443
:Else
45-
1 p Frame'Alias "',alias,'" is already in use with a different path - alias not assigned'
44+
(1 parms.batch)p'Alias "',alias,'" is already in use with a different path - alias not assigned'
4645
:EndIf
4746
:EndIf
4847
:EndIf

APLSource/Cider/Box.aplf

Lines changed: 0 additions & 22 deletions
This file was deleted.

APLSource/Cider/CheckForGit.aplf

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
{r}←CheckForGit(path config);status;dmx
2-
⍝ Checks whether the project is managed by Git, and if so offers some help
1+
{r}←CheckForGit(path config parms);status;dmx
2+
⍝ Checks whether the project is managed by Git, and if so offers some help, unless parms.batch=1
33
r←⍬
4-
:If F.Exists(AddSlash path),'.git'
4+
:If 0=parms.batch
5+
:AndIf F.Exists(AddSlash path),'.git'
56
:Trap 0
67
status←G.Status path
78
:Else
89
dmx←⎕DMX
910
:If 127=dmx.EN
10-
p'The project appears to be managed by Git but Git is not installed?!'
11+
(1 parms.batch)p'The project appears to be managed by Git but Git is not installed?!'
1112
:Return
1213
:ElseIf 128=dmx.EN
13-
p'The project appears to be managed by Git but user.email and/or user.name are not defined'
14+
(1 parms.batch)p'The project appears to be managed by Git but user.email and/or user.name are not defined'
1415
:Return
1516
:ElseIf 0<≢dmx.Message
16-
⎕←'The Git status of the project could not be determined due to an error:'
17-
⎕←dmx.Message,'; rc=',⍕dmx.EN
17+
(1 parms.batch)p'The Git status of the project could not be determined due to an error:'
18+
(1 parms.batch)pdmx.Message,'; rc=',⍕dmx.EN
1819
:Return
1920
:Else
20-
⎕←'The Git status of the project could not be determined due to an error'
21+
(1 parms.batch)p'The Git status of the project could not be determined due to an error'
2122
:Return
2223
:EndIf
2324
:EndTrap
2425
:If ∧/∨/¨'nothing to commit' 'working tree clean'⍷¨⊂∊status
2526
:AndIf ~∨/∨/¨'on branch main' 'on branch master'⍷¨⊂⎕C∊status
26-
⎕←'Git: ',(1⊃status),', ',⊃{⍺,', ',⍵}/1↓status
27-
:Else
27+
(1 parms.batch)p'Git: ',(1⊃status),', ',⊃{⍺,', ',⍵}/1↓status
28+
:ElseIf 0=parms.batch
2829
status←(↓(,[0.5]'Git status report')⍪'='),status
2930
{{}(#.⎕NS'').(⎕ED⍠('ReadOnly' 1)&{'GIT_Status_Report'}GIT_Status_Report←⍵)}⍪status
3031
:EndIf

APLSource/Cider/CheckOnToDo.aplf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{r}←CheckOnToDo ref
1+
{r}←parms CheckOnToDo ref
22
⍝ Checks whether there is a non-empty variable "ToDo" in the root of the project, and put it into ⎕ED if so.
33
⍝ Returns a 1 if found and 0 otherwise
44
r←0
55
:If 2=ref.⎕NC'ToDo'
66
:AndIf 0<≢(∊ref.ToDo)~' '
7-
⎕←'>>> Found a variable ',(⍕ref),'.ToDo'
8-
⎕←Box Frame ref.ToDo
7+
(1 parms.batch)p'>>> Found a variable ',(⍕ref),'.ToDo'
8+
(1 parms.batch)p ref.ToDo
99
r←1
1010
:EndIf

APLSource/Cider/CheckPackagesStatus.aplf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
:If 0≢parms.checkPackageVersions
1313
:AndIf 2>pkgStatus
1414
:If (⊂parms.checkPackageVersions)∊⍬ 1
15-
:AndIf ~parms.quietFlag
15+
:AndIf 0=parms.batch
1616
checkFlag←0 C.YesOrNo' Report availability of later versions of installed Tatin packages?'
1717
:Else
1818
checkFlag←2≡parms.checkPackageVersions
@@ -25,10 +25,10 @@
2525
1 ⎕SE._Tatin.Client.EstablishRumbaClients ⍬
2626
:If 0<≢report←report CheckTatinFoldersForLaterVersions parms folders
2727
:AndIf 0=+/⊃,/4⌷[2]¨report
28-
p' No later versions found '
28+
(1 parms.batch)p'No later versions found '
2929
:If 0<≢buff←(⊂'https://tatin.dev/')~⍨⊃,/3⌷[2]¨report
3030
plural←1<≢buff
31-
1 p Frame{'Note that ',(⍕≢⍵),' package',(plural/'s'),((1+plural)⊃' was' ' were'),' loaded from ',⊃{⍺,',',⍵}/∪⍵}buff
31+
(1 parms.batch)p{'Note that ',(⍕≢⍵),' package',(plural/'s'),((1+plural)⊃' was' ' were'),' loaded from ',⊃{⍺,',',⍵}/∪⍵}buff
3232
:EndIf
3333
:Else
3434
report←{⍵[;4]⌿⍵}¨report

APLSource/Cider/CheckParameters.aplf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{config}←CheckParameters config;list;bool;list2
2-
⍝ Check the parameters for being complete and valid
2+
⍝ Check the parameters for being complete and valid
33
p'Checking parameters...'
44
list←' '~⍨¨⊃,/↓¨config.(LINK CIDER).⎕NL 2 9
55
list2←list~GetValidCiderParams
@@ -13,4 +13,5 @@
1313
list←' '~⍨¨↓config.CIDER.⎕NL 2 9
1414
bool←GetValidCiderParams∊list
1515
('Missing Cider parameter',((1<+/~bool)/'s'),': ',{0=≢⍵:'' ⋄ ⊃{⍺,',',⍵}/⍵}(~bool)/GetValidCiderParams)Assert∧/bool
16-
p' All fine'
16+
p'Parameters are okay'
17+
⍝Done

APLSource/Cider/CheckTargetNamespaceAndLinkFolder.aplf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
⍝ 4. In case only the folder is empty no action is taken
66
⍝ 5. In case neither the namespace `ref` nor the folder are empty the user is asked
77
⍝ whether she wants the namespace to be recreated; if not an error is thrown.
8-
⍝ When `quietFlag` is set however then either the namepace or the folder or both must
8+
⍝ When `batch` is set however, then either the namepace or the folder or both must
99
⍝ be empty, otherwise an error is thrown.
1010
:If (⎕NC⊂⍕ref)∊9.1 9.4 9.5
1111
nsIsEmpty←0=≢' '~¨⍨↓ref.⎕NL⍳16
@@ -20,8 +20,8 @@
2020
:OrIf folderIsEmpty∧nsIsEmpty
2121
:Return
2222
:EndIf
23-
:If parms.quietFlag
24-
⍝ With quietFlag being true there is nothing we can do but throw an error
23+
:If parms.batch
24+
⍝ With `batch` being true there is nothing we can do but throw an error
2525
'Both the target and the source folder are not empty'Assert 0
2626
:Else
2727
:If C.YesOrNo'Target "',(⍕ref),'" is not empty - recreate?'

APLSource/Cider/CheckTatinFoldersForLaterVersions.aplf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:For folder :In folders
44
folder_←⊃'='(≠⊆⊢)folder
55
:If F.Exists parms.folder,'/',folder_
6-
p' Checking Tatin packages in <',(AddSlash folder_),'> ...'
6+
p'Checking Tatin packages in <',(AddSlash folder_),'> ...'
77
folder_←parms.folder,'/',folder_
88
:If 0<≢⊃0 ⎕NINFO⍠('Wildcard' 1)⊣folder_,'/*'
99
:Trap 998
@@ -13,14 +13,14 @@
1313
:If qdmx.EM≡'The build list carries entries that are not on the Tatin Registry search path'
1414
msg←''
1515
msg,←⊂'ERROR: Checking for later versions of Tatin packages failed:'
16-
msg,←⊂' ',qdmx.EM
17-
1 p Frame msg
16+
msg,←⊂' ',qdmx.EM
17+
(1 parms.batch)p msg
1818
:Else
1919
qdmx.EM ⎕SIGNAL 998
2020
:EndIf
2121
:EndTrap
2222
:Else
23-
p' Folder is empty'
23+
(1 parms.batch)p'Installation folder <',parms.folder,'/',folder,'> is empty'
2424
:EndIf
2525
:EndIf
2626
:EndFor

APLSource/Cider/CloseProject.aplf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
⍝ 4. One or more paths of currently open projects
99
⍝ 5. A mixture of 2, 3 and 4
1010
⍝ Returns the number of projects closed.
11-
:Access Public Shared
1211
r←0
1312
list←{0=⎕NC ⍵:ListOpenProjects 1 ⋄ ⍎⍵}'list'
1413
:If 0<≢list

APLSource/Cider/CreateOpenParms.aplf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
⍝ Creates a namespace with all parameters one might pass to `OpenProject`.\\
33
⍝ `y` might be an empty vector or a namespace with some such parameters.
44
⍝ Any parameters passed this way overwrite defaults.
5-
:Access Public Shared
65
parms←(1⊃1↓⎕RSI,⎕THIS).⎕NS'' ⍝ Create namespace where we got called from
76
parms.folder←''
87
parms.projectSpace←''
9-
parms.quietFlag←0
108
parms.alias←''
119
parms.parent←''
1210
parms.suppressInit←0
1311
parms.ignoreUserExec←0
1412
parms.importFlag←0
1513
parms.noPkgLoad←0
14+
parms.verbose←GetGlobalVerboseDefault
15+
parms.batch←0
1616
parms.watch←(1+HasDotNet)⊃'ns' 'both'
1717
parms.checkPackageVersions←⍬ ⍝ ⍬ means the user will be asked; 0 means don't. 1 means yes, check, but ask before updating, 2 means update
1818
:If ~(⊂y)∊''⍬

0 commit comments

Comments
 (0)