Skip to content

Commit 90e1a1b

Browse files
committed
make printCredits shut up if we ask him
1 parent ac5dd0c commit 90e1a1b

File tree

3 files changed

+57
-47
lines changed

3 files changed

+57
-47
lines changed

checkCFG.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
% check that we have all the fields that we need in the experiment parameters
55
% reuses a lot of code from the BIDS starter kit
66

7-
checkCppBidsDependencies();
8-
97
if nargin < 1 || isempty(cfg)
108
cfg = struct();
119
end
10+
11+
checkCppBidsDependencies(cfg);
1212

13-
%% set the cfg defaults
13+
%% list the defaults to set
1414

1515
fieldsToSet.verbose = false;
1616

@@ -43,6 +43,7 @@
4343

4444
fieldsToSet = transferInfoToBids(fieldsToSet, cfg);
4545

46+
%% Set defaults
4647
cfg = setDefaultFields(cfg, fieldsToSet);
4748

4849
end

checkCppBidsDependencies.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function checkCppBidsDependencies()
1+
function checkCppBidsDependencies(cfg)
22
% checkCppBidsDependencies()
33
%
44

@@ -10,7 +10,7 @@ function checkCppBidsDependencies()
1010
addpath(fullfile(pth, 'lib', 'utils'));
1111
addpath(fullfile(pth, 'subfun'));
1212

13-
printCreditsCppBids();
13+
printCreditsCppBids(cfg);
1414

1515
end
1616

printCreditsCppBids.m

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,53 @@
1-
function printCreditsCppBids()
2-
3-
version = '0.0.1';
4-
5-
contributors = { ...
6-
'Rémi Gau', ...
7-
'Marco Barilari', ...
8-
'Ceren Battal'};
9-
10-
% DOI_URL = 'https://doi.org/10.5281/zenodo.3554331.';
11-
12-
repoURL = 'https://github.com/cpp-lln-lab/CPP_BIDS';
13-
14-
fprintf('\n\n');
15-
16-
disp('___________________________________________________');
17-
disp('___________________________________________________');
18-
disp(' ');
19-
disp(' ___ ___ ___ ___ ___ ___ ___ ');
20-
disp(' / __| _ \ _ \ | _ )_ _| \/ __|');
21-
disp(' | (__| _/ _/ | _ \| || |) \__ \');
22-
disp(' \___|_| |_| |___/___|___/|___/');
23-
disp(' ');
24-
25-
splash = 'Thank you for using the CPP BIDS - version %s. ';
26-
fprintf(splash, version);
27-
fprintf('\n\n');
28-
29-
fprintf('Current list of contributors includes:\n');
30-
for iCont = 1:numel(contributors)
31-
fprintf(' %s\n', contributors{iCont});
1+
function printCreditsCppBids(cfg)
2+
3+
verbose = true;
4+
if ~isempty(cfg) && isfield(cfg, 'verbose') && ~isempty(cfg.verbose)
5+
verbose = cfg.verbose;
326
end
33-
fprintf('\b\n\n');
34-
35-
% fprintf('Please cite using the following DOI: \n %s\n\n', DOI_URL)
36-
37-
fprintf('For bug report, suggestions or contributions see: \n %s\n\n', repoURL);
38-
39-
disp('___________________________________________________');
40-
disp('___________________________________________________');
41-
42-
fprintf('\n\n');
43-
7+
8+
if verbose
9+
10+
version = '0.0.1';
11+
12+
contributors = { ...
13+
'Rémi Gau', ...
14+
'Marco Barilari', ...
15+
'Ceren Battal'};
16+
17+
% DOI_URL = 'https://doi.org/10.5281/zenodo.3554331.';
18+
19+
repoURL = 'https://github.com/cpp-lln-lab/CPP_BIDS';
20+
21+
fprintf('\n\n');
22+
23+
disp('___________________________________________________');
24+
disp('___________________________________________________');
25+
disp(' ');
26+
disp(' ___ ___ ___ ___ ___ ___ ___ ');
27+
disp(' / __| _ \ _ \ | _ )_ _| \/ __|');
28+
disp(' | (__| _/ _/ | _ \| || |) \__ \');
29+
disp(' \___|_| |_| |___/___|___/|___/');
30+
disp(' ');
31+
32+
splash = 'Thank you for using the CPP BIDS - version %s. ';
33+
fprintf(splash, version);
34+
fprintf('\n\n');
35+
36+
fprintf('Current list of contributors includes:\n');
37+
for iCont = 1:numel(contributors)
38+
fprintf(' %s\n', contributors{iCont});
39+
end
40+
fprintf('\b\n\n');
41+
42+
% fprintf('Please cite using the following DOI: \n %s\n\n', DOI_URL)
43+
44+
fprintf('For bug report, suggestions or contributions see: \n %s\n\n', repoURL);
45+
46+
disp('___________________________________________________');
47+
disp('___________________________________________________');
48+
49+
fprintf('\n\n');
50+
51+
end
52+
4453
end

0 commit comments

Comments
 (0)