AuroraRuntime/Include/Aurora/CmdLine
Jamie Reece Wilson 83f34b0c47 [*] I was right. String views are [mostly] pointless (*)
03:28:55:638  17>2 of 53388 functions (<0.1%) were compiled, the rest were copied from previous compilation.
03:28:55:638  17>  0 functions were new in current compilation
03:28:55:638  17>  65 functions had inline decision re-evaluated but remain unchanged
03:28:56:749  17>Finished generating code

the header of const AuString & is the same as std::string_view therefore nothing changes. in fact, we still need to alloc strings a bunch of times for a zero terminated string. worse, <c++20 always allocs each time we want to access a hashmap with o(1) lookup, making small hashmaps kinda pointless when we always have to alloc+copy (thx std)

perhaps this will help some language binders
2024-04-19 05:58:08 +01:00
..
CmdLine.hpp [*] I was right. String views are [mostly] pointless (*) 2024-04-19 05:58:08 +01:00
README.md [+] NS readmes 2022-06-12 18:28:51 +01:00

AuCmdLine

Example Usage:
File: HelloAurora/master/Tests/Public/3. Hello Command Line/Main.cpp
Example: https://cyberia.tokyo/notice/AHx8CkwoqqW26byDJ2

Platform normalization

Different shells will parse execv or generate the process command line string differently
For instance, to take the flag 'Hello World' and pass it to a program without additional CLI parsing, you would need to write:

Powershell: & '.\3. Hello Command Line.Stage.Win32.x86_64.exe' Hello` World
CMD : "3. Hello Command Line.Stage.Win32.x86_64.exe" "Hello World"
Linux : ./3.\ Hello\ Command\ Line.Stage.Linux.x86_64 Hello\ World

Despite this, GetFlags and GetValues will unescape \ on NT platforms.

EG:
"3. Hello Command Line.Stage.Win32.x86_64.exe" --test=Hello\ World
"3. Hello Command Line.Stage.Win32.x86_64.exe" --test="Hello World"
"3. Hello Command Line.Stage.Win32.x86_64.exe" --test "Hello World"
"3. Hello Command Line.Stage.Win32.x86_64.exe" /test="Hello World"
"3. Hello Command Line.Stage.Win32.x86_64.exe" /test "Hello World"
"3. Hello Command Line.Stage.Win32.x86_64.exe" test="Hello World"
"3. Hello Command Line.Stage.Win32.x86_64.exe" test=Hello\ World
[2022-02-20 18:25:48][Info] | Flags: 0
[2022-02-20 18:25:48][Info] | Values: 1
[2022-02-20 18:25:48][Info] | test=Hello World \