AuroraRuntime/Include/Aurora/CmdLine/README.md
2022-06-12 18:28:51 +01:00

1.4 KiB

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 \