Skip to content

Commit c1ad88a

Browse files
committed
fix
1 parent 56cbacf commit c1ad88a

File tree

9 files changed

+56
-25
lines changed

9 files changed

+56
-25
lines changed

docs/commands/bpm_config/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@
6363
<li class="toctree-l2 current"><a class="reference internal current" href="#">2.2.5. bpm config</a>
6464
<ul class="current">
6565
<li class="toctree-l3"><a class="reference internal" href="#bpm-config-set">bpm config set</a>
66-
</li>
67-
<li class="toctree-l3"><a class="reference internal" href="#bpm-config-add">bpm config add</a>
6866
<ul>
69-
<li class="toctree-l4"><a class="reference internal" href="#bpm-config-add-project-binary">bpm config add project binary</a>
67+
<li class="toctree-l4"><a class="reference internal" href="#bpm-config-add-project-binary-add-a-source-code-to-build-during-build-stage">bpm config add project binary : add a source code to build during build stage</a>
7068
</li>
7169
</ul>
7270
</li>
@@ -159,10 +157,12 @@ <h1 id="bpm-config">bpm config</h1>
159157
md2hlp Activate md2hlp : enable set to yer, disabled set to no
160158
</code></pre>
161159
<h2 id="bpm-config-set">bpm config set</h2>
162-
<h2 id="bpm-config-add">bpm config add</h2>
163-
<h3 id="bpm-config-add-project-binary">bpm config add project binary</h3>
160+
<p>"config set" can be used to set any parameter in global configuration (main) or project configuration</p>
161+
<h3 id="bpm-config-add-project-binary-add-a-source-code-to-build-during-build-stage">bpm config add project binary : add a source code to build during build stage</h3>
162+
<p>For example, we want to add curl.c into build stage with the output name called "curl"</p>
164163
<p>Add a "curl" binary into bin list to generate :</p>
165-
<p>"bpm config add project binary curl tests/curl.c"</p>
164+
<pre><code class="language-bash">bpm config add project binary curl tests/curl.c
165+
</code></pre>
166166
<p>In that case, "bpm run --bin curl" will launch "curl" compiled from tests/curl.c</p>
167167
<h2 id="add-a-pre-script-before-main-command-is-launched">Add a pre script before main command is launched</h2>
168168
<pre><code class="language-bash">$ mkdir scripts/

docs/search/search_index.json

+1-1
Large diffs are not rendered by default.

docs/sitemap.xml.gz

0 Bytes
Binary file not shown.

mkdocs/docs/commands/bpm_config.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ Project parameters are :
2727
2828
## bpm config set
2929
30-
## bpm config add
30+
"config set" can be used to set any parameter in global configuration (main) or project configuration
3131
32-
### bpm config add project binary
32+
### bpm config add project binary : add a source code to build during build stage
33+
34+
For example, we want to add curl.c into build stage with the output name called "curl"
3335
3436
Add a "curl" binary into bin list to generate :
3537
36-
"bpm config add project binary curl tests/curl.c"
38+
```bash
39+
bpm config add project binary curl tests/curl.c
40+
```
3741
3842
In that case, "bpm run --bin curl" will launch "curl" compiled from tests/curl.c
3943
@@ -44,3 +48,4 @@ $ mkdir scripts/
4448
$ echo "netchk" > scripts/network.sub
4549
$ bpm config set project orix_run_pre_script scripts/network.sub
4650
```
51+

mkdocs/docs/commands/bpm_run.md

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ bpm run --bin "hello -y"
4040

4141
bpm run -- arg1 arg2
4242

43-
44-
4543
## Launch a command before the project program (only for bin program)
4644

4745
```bash

mkdocs/site/commands/bpm_config/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@
6363
<li class="toctree-l2 current"><a class="reference internal current" href="#">2.2.5. bpm config</a>
6464
<ul class="current">
6565
<li class="toctree-l3"><a class="reference internal" href="#bpm-config-set">bpm config set</a>
66-
</li>
67-
<li class="toctree-l3"><a class="reference internal" href="#bpm-config-add">bpm config add</a>
6866
<ul>
69-
<li class="toctree-l4"><a class="reference internal" href="#bpm-config-add-project-binary">bpm config add project binary</a>
67+
<li class="toctree-l4"><a class="reference internal" href="#bpm-config-add-project-binary-add-a-source-code-to-build-during-build-stage">bpm config add project binary : add a source code to build during build stage</a>
7068
</li>
7169
</ul>
7270
</li>
@@ -159,10 +157,12 @@ <h1 id="bpm-config">bpm config</h1>
159157
md2hlp Activate md2hlp : enable set to yer, disabled set to no
160158
</code></pre>
161159
<h2 id="bpm-config-set">bpm config set</h2>
162-
<h2 id="bpm-config-add">bpm config add</h2>
163-
<h3 id="bpm-config-add-project-binary">bpm config add project binary</h3>
160+
<p>"config set" can be used to set any parameter in global configuration (main) or project configuration</p>
161+
<h3 id="bpm-config-add-project-binary-add-a-source-code-to-build-during-build-stage">bpm config add project binary : add a source code to build during build stage</h3>
162+
<p>For example, we want to add curl.c into build stage with the output name called "curl"</p>
164163
<p>Add a "curl" binary into bin list to generate :</p>
165-
<p>"bpm config add project binary curl tests/curl.c"</p>
164+
<pre><code class="language-bash">bpm config add project binary curl tests/curl.c
165+
</code></pre>
166166
<p>In that case, "bpm run --bin curl" will launch "curl" compiled from tests/curl.c</p>
167167
<h2 id="add-a-pre-script-before-main-command-is-launched">Add a pre script before main command is launched</h2>
168168
<pre><code class="language-bash">$ mkdir scripts/

mkdocs/site/search/search_index.json

+1-1
Large diffs are not rendered by default.

mkdocs/site/sitemap.xml.gz

0 Bytes
Binary file not shown.

src/bpm

+34-6
Original file line numberDiff line numberDiff line change
@@ -1227,14 +1227,16 @@ def manage_config(args):
12271227
i = i + 1
12281228
return 0
12291229

1230-
if len(args) == 5:
12311230
if args[4] == '-h' and args[2] == 'add' and args[3] == 'project':
12321231
print("Manage config\n")
1233-
print("Usage : bpm config add project binary binarybin path\n")
1234-
print("\033[1;32mParameters\033[0m")
1232+
print("Usage : bpm config add project\n")
1233+
print("\033[1;32mCommands\033[0m")
1234+
print(" \033[1;36mbinary\033[0m set a binary to build")
1235+
print(" \033[1;36mdynamic-lib\033[0m set a dynamic lib to build (not done yet)")
1236+
#print("binary binarybin source path")
12351237
i = 0
1238+
return 0
12361239

1237-
if len(args) == 5:
12381240
if args[4] == '-h' and args[2] == 'set' and args[3] == 'project':
12391241
print("Manage config\n")
12401242
print("Usage : bpm config set project parameter value\n")
@@ -1255,14 +1257,32 @@ def manage_config(args):
12551257
print(" \033[1;36mproject\033[0m set value for 'project' config (use -h after set for 'project' help)")
12561258
return 0
12571259

1260+
if args[3] == '-h' and args[2] == 'add':
1261+
print("Manage config\n")
1262+
print("Usage : bpm config set [command]\n")
1263+
print("\033[1;32mCommands:\033[0m")
1264+
print(" \033[1;36mproject\033[0m set a add value for 'project'")
1265+
return 0
1266+
12581267
if len(args) == 3:
12591268
if args[2] == '-h' or args[2] == 'help':
12601269
print("Manage config\n")
12611270
print("Usage : bpm config [command]\n")
12621271
print("\033[1;32mCommands:\033[0m")
12631272
print(" \033[1;36mset\033[0m set value for main config or project config (use -h after set for 'set' help)")
1273+
print(" \033[1;36madd\033[0m add a binary into project file")
1274+
return 0
1275+
1276+
if args[2] == 'add':
1277+
print('Missing parameter')
1278+
print("Manage config\n")
1279+
print("Usage : bpm config [command]\n")
1280+
print("\033[1;32mCommands:\033[0m")
1281+
print(" \033[1;36mset\033[0m set value for main config or project config (use -h after set for 'set' help)")
1282+
print(" \033[1;36madd\033[0m add a binary into project file")
12641283
return 0
12651284

1285+
12661286
if len(args) == 5:
12671287
if args[4] not in valid_parameters_project and args[3] == 'project':
12681288
print("'" + args[4] + "' is not a parameter allowed for '" + args[3] + "'")
@@ -1274,13 +1294,14 @@ def manage_config(args):
12741294

12751295
if args[2] == 'set' and args[3] == 'main':
12761296
print("Missing value for parameter '" + args[4] + "'")
1277-
return
1297+
return 1
12781298

12791299
if args[2] == 'set' and args[3] == 'project':
12801300
print("Missing value for parameter '" + args[4] + "'")
1281-
return
1301+
return 1
12821302

12831303
if len(args) == 7:
1304+
12841305
if args[2] == 'add' and args[3] == 'project' and args[4] == 'binary':
12851306
#bpm config add project binary binarybin path
12861307
with open("bpm.tml", "r") as file:
@@ -1294,8 +1315,15 @@ def manage_config(args):
12941315
# Enregistrer les modifications dans le fichier
12951316
with open("bpm.tml", "w") as file:
12961317
toml.dump(data, file)
1318+
print("Binary added")
1319+
return 0
12971320

12981321
if len(args) == 6:
1322+
if args[2] == 'add' and args[3] == 'project' and args[4] == 'binary' and args[5] == '-h':
1323+
print("Manage config : add a binary to project\n")
1324+
print("Usage : bpm config add project binary [name of the binary] [path_of_the_source_code]\n")
1325+
return 0
1326+
12991327
if args[2] == 'set' and args[3] == 'main':
13001328
if args[4] in valid_parameters_main:
13011329
verify_position = valid_parameters_main.index(args[4])

0 commit comments

Comments
 (0)