Skip to content

Commit 9d185dc

Browse files
committed
Working Argument Parser
The argument parser can process int, float and string data. It has some examples. Documentation still neds some work. Unit tests are missing.
1 parent 9dbdf1a commit 9d185dc

File tree

289 files changed

+76440
-2446
lines changed

Some content is hidden

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

289 files changed

+76440
-2446
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/*
2+
!build/README.md

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,30 @@ endif()
9999
#---- Examples Section ----#
100100

101101
if( BUILD_EXAMPLES )
102+
add_executable( Argumentadvanced ${SOURCES} extras/examples_desktop/Desktop/Argumentadvanced/Argumentadvanced.cpp )
102103
add_executable( Argumentbasic ${SOURCES} extras/examples_desktop/Desktop/Argumentbasic/Argumentbasic.cpp )
103104
add_executable( Basic ${SOURCES} extras/examples_desktop/Desktop/Basic/Basic.cpp )
105+
add_executable( Description ${SOURCES} extras/examples_desktop/Desktop/Description/Description.cpp )
106+
add_executable( Help ${SOURCES} extras/examples_desktop/Desktop/Help/Help.cpp )
107+
add_executable( Interactive ${SOURCES} extras/examples_desktop/Desktop/Interactive/Interactive.cpp )
104108
endif()
105109
if( BUILD_WEBASSEMBLY )
110+
add_executable( Argumentadvanced ${SOURCES} extras/examples_emscripten/Emscripten/Argumentadvanced/Argumentadvanced.cpp )
111+
target_link_options( Argumentadvanced PUBLIC -sNO_EXIT_RUNTIME=1 -sFORCE_FILESYSTEM=1 -sRETAIN_COMPILER_SETTINGS -sASYNCIFY )
112+
106113
add_executable( Argumentbasic ${SOURCES} extras/examples_emscripten/Emscripten/Argumentbasic/Argumentbasic.cpp )
107114
target_link_options( Argumentbasic PUBLIC -sNO_EXIT_RUNTIME=1 -sFORCE_FILESYSTEM=1 -sRETAIN_COMPILER_SETTINGS -sASYNCIFY )
108115

109116
add_executable( Basic ${SOURCES} extras/examples_emscripten/Emscripten/Basic/Basic.cpp )
110117
target_link_options( Basic PUBLIC -sNO_EXIT_RUNTIME=1 -sFORCE_FILESYSTEM=1 -sRETAIN_COMPILER_SETTINGS -sASYNCIFY )
111118

119+
add_executable( Description ${SOURCES} extras/examples_emscripten/Emscripten/Description/Description.cpp )
120+
target_link_options( Description PUBLIC -sNO_EXIT_RUNTIME=1 -sFORCE_FILESYSTEM=1 -sRETAIN_COMPILER_SETTINGS -sASYNCIFY )
121+
122+
add_executable( Help ${SOURCES} extras/examples_emscripten/Emscripten/Help/Help.cpp )
123+
target_link_options( Help PUBLIC -sNO_EXIT_RUNTIME=1 -sFORCE_FILESYSTEM=1 -sRETAIN_COMPILER_SETTINGS -sASYNCIFY )
124+
125+
add_executable( Interactive ${SOURCES} extras/examples_emscripten/Emscripten/Interactive/Interactive.cpp )
126+
target_link_options( Interactive PUBLIC -sNO_EXIT_RUNTIME=1 -sFORCE_FILESYSTEM=1 -sRETAIN_COMPILER_SETTINGS -sASYNCIFY )
127+
112128
endif()

Doxyfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROJECT_BRIEF = "Simple Command Parser"
6161
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
6262
# the logo to the output directory.
6363

64-
PROJECT_LOGO = docs/images/logo.svg
64+
PROJECT_LOGO = C:/Users/dani0/Documents/Programok/Commander-API/docs/images/logo.svg
6565

6666
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
6767
# into which the generated documentation will be written. If a relative path is
@@ -795,7 +795,7 @@ FILE_VERSION_FILTER =
795795
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
796796
# tag is left empty.
797797

798-
LAYOUT_FILE =
798+
LAYOUT_FILE = docs/Style/layout.xml
799799

800800
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
801801
# the reference definitions. This must be a list of .bib files. The .bib
@@ -1043,7 +1043,7 @@ EXCLUDE_SYMBOLS =
10431043
# that contain example code fragments that are included (see the \include
10441044
# command).
10451045

1046-
EXAMPLE_PATH =
1046+
EXAMPLE_PATH = extras/examples_doxygen
10471047

10481048
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
10491049
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -1057,7 +1057,7 @@ EXAMPLE_PATTERNS = *
10571057
# irrespective of the value of the RECURSIVE tag.
10581058
# The default value is: NO.
10591059

1060-
EXAMPLE_RECURSIVE = NO
1060+
EXAMPLE_RECURSIVE = YES
10611061

10621062
# The IMAGE_PATH tag can be used to specify one or more files or directories
10631063
# that contain images that are to be included in the documentation (see the

build.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@
3939
import getopt
4040
import json
4141
from jinja2 import Template
42+
import datetime
4243

4344
# Badge generator
4445
import anybadge
4546

47+
# Get the current time
48+
currentTime = datetime.datetime.now()
49+
4650
# Collect input arguments
4751
argv = sys.argv[ 1: ]
4852

@@ -280,7 +284,10 @@
280284
# Parameter fields.
281285
fields = {
282286
'EXAMPLE_NAME': fileName,
283-
'EXAMPLE_PATH': "./" + fileName + ".js"
287+
'EXAMPLE_PATH': "./" + fileName + ".js",
288+
'YEAR': currentTime.strftime( "%Y" ),
289+
'MONTH': currentTime.strftime( "%b" ),
290+
'DAY': currentTime.strftime( "%d" )
284291
}
285292

286293
# Create a template object from the template file.

docs/Style/layout.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<navindex>
2+
<tab type="mainpage" visible="yes" title="Home"/>
3+
<tab type="usergroup" visible="yes" url="@ref supported_platforms" title="💻 Supported Platforms" intro=""/>
4+
<tab type="usergroup" visible="yes" url="@ref example_codes" title="📖 Examples">
5+
<tab type="usergroup" visible="yes" url="@ref example_basic" title="Basic" intro=""/>
6+
<tab type="usergroup" visible="yes" url="@ref example_help" title="Help" intro=""/>
7+
<tab type="usergroup" visible="yes" url="@ref example_description" title="Description" intro=""/>
8+
<tab type="usergroup" visible="yes" url="@ref example_interactive" title="Interactive" intro=""/>
9+
<tab type="usergroup" visible="yes" url="@ref example_codes" title="💲 Arguments">
10+
<tab type="usergroup" visible="yes" url="@ref example_argumentbasic" title="Basic" intro=""/>
11+
</tab>
12+
</tab>
13+
<tab type="modules" visible="yes" title="" intro=""/>
14+
<tab type="namespaces" visible="yes" title="">
15+
<tab type="namespacelist" visible="yes" title="" intro=""/>
16+
<tab type="namespacemembers" visible="yes" title="" intro=""/>
17+
</tab>
18+
<tab type="usergroup" visible="yes" url="@ref api" title="🚀 API">
19+
<tab type="classes" visible="yes" title="">
20+
<tab type="classlist" visible="yes" title="" intro=""/>
21+
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
22+
<tab type="hierarchy" visible="yes" title="" intro=""/>
23+
<tab type="classmembers" visible="yes" title="" intro=""/>
24+
</tab>
25+
</tab>
26+
<tab type="usergroup" visible="yes" url="@ref coverage" title="📈 Coverage" intro=""/>
27+
<tab type="usergroup" visible="yes" url="@ref developer_zone" title="🚧 Developer Zone" intro=""/>
28+
</navindex>

docs/html/Argumentbasic.html

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<!doctype html>
2+
<!--
3+
* Created on June 25 2023
4+
*
5+
* Copyright (c) 2023 - Daniel Hajnal
6+
7+
* This file is part of the Shellminator project.
8+
* Modified 2022.06.25
9+
10+
MIT License
11+
12+
Copyright (c) 2022 Daniel Hajnal
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in all
22+
copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
SOFTWARE.
31+
-->
32+
33+
<html>
34+
35+
<style>
36+
37+
.terminal-container {
38+
overflow: hidden;
39+
margin: 0;
40+
position: absolute;
41+
top: 50%;
42+
left: 50%;
43+
transform: translate( -50%, -50% );
44+
box-shadow: 0px 0px 20px #34495E;
45+
}
46+
47+
</style>
48+
49+
<head>
50+
<title>Argumentbasic</title>
51+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/xterm.css">
52+
</head>
53+
<body>
54+
<div class="terminal-container" id="terminal">
55+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/xterm.min.js"></script>
56+
<script>
57+
58+
let inputText = "";
59+
let stdinBuffer = [];
60+
let stdinBufferPtr = 0;
61+
62+
/* Create a new xTerm object */
63+
const term = new Terminal({
64+
cursorBliknk: "true",
65+
cursorStyle: "bar",
66+
});
67+
68+
term.onData( data => {
69+
70+
//inputChar = data;
71+
inputText = data;
72+
for (const c of data) {
73+
stdinBuffer.push( c.charCodeAt( 0 ) );
74+
}
75+
76+
console.log( stdinBuffer );
77+
78+
} );
79+
80+
term.open(document.getElementById("terminal"));
81+
82+
var Module;
83+
84+
85+
</script>
86+
<script src=./Argumentbasic.js></script>
87+
</body>
88+
</html>

0 commit comments

Comments
 (0)