Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"We don't have to protect the environment -- the Second Coming is at hand." -- James Watt


devel / comp.lang.c / Re: Commandline parsing

SubjectAuthor
* Commandline parsingMalcolm McLean
+- Re: Commandline parsingLew Pitcher
+- Re: Commandline parsingScott Lurndal
+- Re: Commandline parsingSpiros Bousbouras
+* Re: Commandline parsingKenny McCormack
|`- Re: Commandline parsingMalcolm McLean
+* Re: Commandline parsingLynn McGuire
|+* Re: Commandline parsingLynn McGuire
||`* Re: Commandline parsingMalcolm McLean
|| `* Re: Commandline parsingKeith Thompson
||  `- Re: Commandline parsingMalcolm McLean
|+- Re: Commandline parsingKaz Kylheku
|`- Re: Commandline parsingSpiros Bousbouras
+* Re: Commandline parsingBlue-Maned_Hawk
|+- Re: Commandline parsingMalcolm McLean
|`* Re: Commandline parsingKeith Thompson
| `- Re: Commandline parsingKaz Kylheku
+* Re: Commandline parsingfir
|+* Re: Commandline parsingScott Lurndal
||`- Re: Commandline parsingfir
|`* Re: Commandline parsingMalcolm McLean
| +* Re: Commandline parsingfir
| |`* Re: Commandline parsingfir
| | `* Re: Commandline parsingfir
| |  +* Re: Commandline parsingfir
| |  |`- Re: Commandline parsingfir
| |  +- Re: Commandline parsingfir
| |  `* Re: Commandline parsingfir
| |   `- Re: Commandline parsingfir
| `- Re: Commandline parsingfir
+- Re: Commandline parsingMichael S
`- Re: Commandline parsingJoe Pfeiffer

Pages:12
Re: Commandline parsing

<8f8927ff-34e4-4c0c-8764-991e92a5a5f2n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26881&group=comp.lang.c#26881

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:b483:0:b0:75b:3962:8db3 with SMTP id d125-20020a37b483000000b0075b39628db3mr33603qkf.3.1690832825125;
Mon, 31 Jul 2023 12:47:05 -0700 (PDT)
X-Received: by 2002:a9d:7f0a:0:b0:6b7:45a8:a80c with SMTP id
j10-20020a9d7f0a000000b006b745a8a80cmr13114060otq.3.1690832824807; Mon, 31
Jul 2023 12:47:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 31 Jul 2023 12:47:04 -0700 (PDT)
In-Reply-To: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a0d:6fc2:55b0:ca00:147e:5aff:74ef:a248;
posting-account=ow8VOgoAAAAfiGNvoH__Y4ADRwQF1hZW
NNTP-Posting-Host: 2a0d:6fc2:55b0:ca00:147e:5aff:74ef:a248
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f8927ff-34e4-4c0c-8764-991e92a5a5f2n@googlegroups.com>
Subject: Re: Commandline parsing
From: already5...@yahoo.com (Michael S)
Injection-Date: Mon, 31 Jul 2023 19:47:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2033
 by: Michael S - Mon, 31 Jul 2023 19:47 UTC

On Wednesday, July 26, 2023 at 6:35:05 PM UTC+3, Malcolm McLean wrote:
> Just realised that my options parser isn't publically available, which I have just remedied.
>
> What approaches do people use towards parsing commandline options ? Do you use getopt() ? Or do you find that real world programs have a simple enough set of options that it's easier to write bespoke code?

My own custom parsers.
Always from scratch, I never reuse any parsing code. Except when I start by modifying existing utility
into something not too different.
My command-line parsers are mostly simple, but only mostly. In at least one utility that I had written
~3 years ago it was not simple at all. But in this particular case the syntax was not resembling the style
supported by getopt(), anyway.

Re: Commandline parsing

<377a9e71-7878-42dd-a91d-2cf911d3c23bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26882&group=comp.lang.c#26882

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:620a:7ee:b0:767:e97b:38ab with SMTP id k14-20020a05620a07ee00b00767e97b38abmr33939qkk.4.1690833478525;
Mon, 31 Jul 2023 12:57:58 -0700 (PDT)
X-Received: by 2002:a05:6870:956f:b0:1bb:7345:a595 with SMTP id
v47-20020a056870956f00b001bb7345a595mr13826103oal.1.1690833478258; Mon, 31
Jul 2023 12:57:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 31 Jul 2023 12:57:57 -0700 (PDT)
In-Reply-To: <7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.55; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.55
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
<00a6ddfb-2660-41b0-94d7-48a1d764577an@googlegroups.com> <0f2dce28-ac19-4613-8796-21f721eb97a6n@googlegroups.com>
<ae8bdb37-39bd-400c-aa28-8056b675d501n@googlegroups.com> <706cbf3a-4e6f-4466-a139-2511f00a7e8an@googlegroups.com>
<7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <377a9e71-7878-42dd-a91d-2cf911d3c23bn@googlegroups.com>
Subject: Re: Commandline parsing
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 31 Jul 2023 19:57:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 245
 by: fir - Mon, 31 Jul 2023 19:57 UTC

poniedziałek, 31 lipca 2023 o 21:38:02 UTC+2 fir napisał(a):
>
> some example that a;ready compiles https://fastupload.io/pakja4Guq471ngn/file
>
> input is in input.c output is in furia-output.exe
>
> it generally tends to be extremally simplified extended/modernized c 'variant' or how to call it
>
> rhe funny pieces
>
> void SetupLight
> SetPointLight 0 1 -1100.0 0.0 0.0 7000.0 50000.0 0.30 1.9 1.3 1.3 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01
> SetPointLight 1 3 1100.0 500.0 500.0 7000.0 50000.0 0.30 1.3 1.9 1.3 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01
> SetPointLight 2 3 0.0 -1500.0 -500.0 7000.0 50000.0 0.30 1.3 1.3 1.9 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01 ;
>
> this is most simplified function definition - seems qyite okay (and it compiles so its proven to work)
>
> void ProcessMouseMove mouse_x mouse_y { }
> void ProcessKeyDown key { }
> void OnResize { RunFrame }
>
> alseo 3 function definitions
>
> void RunFrame int advance
> {
> Initialise, ClearFrameData 0x666666
> DrawLine3d 100.0 100.0 0.0 100.0 -100.0 0.0 0xffffff
> DrawLine3d 100.0 -100.0 0.0 -100.0 -100.0 0.0 0xffffff
> DrawLine3d -100.0 -100.0 0.0 -100.0 100.0 0.0 0xffffff
> DrawLine3d -100.0 100.0 0.0 100.0 100.0 0.0 0xffffff
> DrawDot3d 0.0 0.0 100.0 20.0 0x557788
> DrawDot3d 0.0 0.0 150.0 30.0 0x557722
> DrawDot3d 0.0 0.0 -100.0 10.0 0xaa7788
> DrawCloud1, DrawCloud2, DrawCloud21,
> DrawCloud3
> DrawSomeText2F 0xa99999 0x666666 10 20 "hello, this is example program compiled by fir's furia compiler \x00"
> }
>
> same
>
> ints array
>
> new type - resizable array of ints
> may be iaccesed by array[i] using array.size,
> size just may be changed by array.size=29; array.size=100; etc
> has alo method add: array.add(10)
>
> i generate code in assembly for that, i got no head in that so i a bit forgot bout the code for eemiting resizes are sorta like
>
> void EmitResize(chunk name, int size) //for seting new size
> {
> FlushOutAsm("\n push %d", size );
> FlushOutAsmChunkPE("\n push (", name, ") ");
> FlushOutAsm("\n call (\"msvcrt.dll\"->realloc)");
> FlushOutAsmChunkPE("\n mov (", name, ") eax ");
> FlushOutAsm("\n pop edx");
> FlushOutAsm("\n pop edx");
> FlushOutAsmChunkPE("\n mov (", name, ") eax ");
> FlushOutAsm("\n mov eax %d", size);
> FlushOutAsmChunkPE("\n mov (", name, "_size) eax ");
> }
>
> void EmitAdd2DynamicArrayByLabel(chunk name, chunk added) //for add
> {
> //inc size by one
> FlushOutAsmChunkPE("\n mov eax (", name, "_size) ");
>
> FlushOutAsm("\n push eax"); //use to assign
>
> FlushOutAsm("\n add eax 4 ");
> FlushOutAsmChunkPE("\n mov (", name, "_size) eax ");
> //reallock
> FlushOutAsm("\n push eax");
> FlushOutAsmChunkPE("\n push (", name, ") ");
> FlushOutAsm("\n call (\"msvcrt.dll\"->realloc)");
> FlushOutAsmChunkPE("\n mov (", name, ") eax ");
> FlushOutAsm("\n pop edx");
> FlushOutAsm("\n pop edx");
> //add value
> FlushOutAsm("\n pop ebx ");
> FlushOutAsmChunkPE("\n mov eax (", name, ") ");
> FlushOutAsm("\n add eax ebx");
> FlushOutAsmChunkPE("\n mov ebx (", added, ")");
> FlushOutAsm("\n mov (eax) ebx ");
>
>
> }
>
> what i did wrong now are loops and ifs.. i tried to simplify loops maximally
> and made it liek this
>
> 1:100: tab.add(i)
>
> which is loop from 1 to 100, but its clearly wrong need something better
> close problem i got also with ifs..but the pure meat of function definitions and calling above is real nice

i made more syntax options and as far as i know it laso compiles:

//////////////////////////////
import "green_fire.dll" (cdecl) Set3dDrawingMode DrawSomeText2 rand2 ToggleFullscreen ClearFrameData DrawCircle RegisterRunFrame RegisterMouseMove RegisterKeyDown RegisterOnResize SetSleepValue SetScaleOnResize SetupWindow3 (var) frame_size_x frame_size_y frame_bitmap
import "user32.dll" (stdcall) MessageBoxA
import "msvcrt.dll" (cdecl) printf
////////////////////////////////////

def ProcessMouseMove mouse_x mouse_y.

def foo z1 z2 z3 z4:
printf " %d %d %d %d \x00" z1 z2 z3 z4.

def AddBackgrounColor zzz
x = rand2 1 2, background_color += x .

def goo z1 z2 z3 -> z4 z5 z6
{z4=z1+z2, z5=z2+z3, z6=z3+z1}


def doo
{a b c=goo 2 3 4, printf " a %d b %d c %d \x00" a b c }

def ProcessKeyDown last_key_pressed
{
PAGE_UP=33
keyR=0x52
keyG=0x47
keyB=0x42
last_key_pressed?=PAGE_UP {ToggleFullscreen}
last_key_pressed?=0x41 {foo frame_size_x frame_size_y/2 3 4}
last_key_pressed?=0x53 {foo 2|3|4|5,foo 6 7 8 9}
last_key_pressed?=0x43 {MessageBoxA 0 "captionC\x00" "title\x00" 0}
last_key_pressed?=keyR {AddBackgrounColor 0x20}
last_key_pressed?=keyG {AddBackgrounColor 0x2000}
last_key_pressed?=keyB {doo}
}

void RollBackgroundColor: ClearFrameData = 0
;
// ClearFrameData int background_color+=0x010201 ;

void RollCircleColors
int circle_color1+=0x000001
int circle_color2+=0x010000
int circle_color3+=0x000100
int circle_color4+=0x010001 ;

double aa=111111.111111111,
double bb=7.22,
cc=2,
dd=3

void draw_circles {
RollCircleColors
10$r$100$2: DrawCircle frame_size_x/4 frame_size_y/3 r circle_color1;
1$r$100$6: DrawCircle frame_size_x/5*4 frame_size_y/4 r circle_color2;
10$r$70 $4: DrawCircle frame_size_x/6*5 frame_size_y/5*4 r circle_color3;
11$r$70 $4: DrawCircle frame_size_x/6*5 frame_size_y/5*4 r circle_color4;
10$r$100$2: DrawCircle mouse_x mouse_y r 0x991133;
}
void header {
DrawSomeText2 0xffffff|10|20|"this app is compiled by furia \x00"
DrawSomeText2 0xffffff|10|40|" compiler by fir, 2022 \x00"
DrawSomeText2 0xffffff|30|70|"mouse %d %d\x00"|mouse_x|mouse_y
}

void test_operators {
c1 = 0x011111<or>0x020202
c2 = 0x011111<and>0x020202
c3 = 0x011111<xor>0x020202
c4 = 0xc0000000+0x50000010
c5 = 0xc0000000<adc>0x50000010
c12 = 1 <rand> 3
c12 = c12 <and> 0xfff
c1=1*1 | c2=2+2 | c3 = 3/3
c10=c1=c2=c3=333
rr = frame_bitmap[4*(mouse_x+frame_size_x*mouse_y)] + 0x777777
frame_bitmap[4*(mouse_x+frame_size_x*mouse_y)]=rr
c1 = 0x011111<or>0x020202 , c2 = 0x011111<and>0x020202
c3 = 0x0fffff<xor>0x020202 , c4 = 0xc0000000+0x50000010
c5 = 0xc0000000<adc>0x50000010 ,
c1 = 0x01234567<shl>1, c2 = 0x01234567<shr>1,
c3 = 0x01234567<sal>1, c4 = 0x01234567<sar>1,
c5 = 0x01234567<rcl>1, c6 = 0x01234567<rcr>1,
c7 = 0x01234567<rol>1, c8 = 0x01234567<ror>1
c1 = (1+1+1)*2+(1*1)+3*(1+1+3*2)
c2 = (1+1+1)*2+(1*1)+3*(1+1+3*2)

c1 = rand2 10 20
// printf " %d \x00" c1
}
void RunFrame:
RollBackgroundColor,
header,
draw_circles,
test_operators,
draw_variables .

void draw_variables
DrawSomeText2 0xffffff|0|160|"c1 %08x c2 %08x c3 %08x \x00"|c1|c2|c3
DrawSomeText2 0xffffff|0|170|"c4 %08x c5 %08x c6 %08x \x00"|c4|c5|c6
DrawSomeText2 0xffffff|0|180|"c7 %08x c8 %08x c9 %08x \x00"|c7|c8|c9
DrawSomeText2 0xffffff|0|190|"c10 %08x c11 %08x c12 %08x \x00"|c10|c11 c12
aa+=0.010101
// aa = c1
DrawSomeText2 0xffffff|10|220|"test aa %f \x00"|aa .

void OnResize1:a?=2:doo;.
void OnResize2:a?=2:doo;;
void OnResize3{a?=2{doo}}

void OnResize.

void main: RegisterRunFrame &RunFrame, RegisterMouseMove &ProcessMouseMove
RegisterKeyDown &ProcessKeyDown, RegisterOnResize &OnResize, SetSleepValue 40,
SetScaleOnResize 1
// Set3dDrawingMode 1
SetupWindow3 " compiled by fir's furia proto c compiler \x00" 20 20 640 480 320 240 .

some of this above is experimental and wrong some is good (the header part with imported symbols is damn ugly but needed = inles i eventually write asemblation and compilation of dlls or at least reading dlls for symbols by default to import all and not write it by hand

i got also idea to define operators ina form of <some> but now i think its wrong, probably operators must be normal words just as imported functions


Click here to read the complete article
Re: Commandline parsing

<0b8b2b81-21a7-465c-99a5-aabc8f281700n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26883&group=comp.lang.c#26883

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:8685:0:b0:767:dc46:ed2d with SMTP id i127-20020a378685000000b00767dc46ed2dmr32613qkd.1.1690834668563;
Mon, 31 Jul 2023 13:17:48 -0700 (PDT)
X-Received: by 2002:a05:6830:22f3:b0:6b8:6c43:12ab with SMTP id
t19-20020a05683022f300b006b86c4312abmr12326014otc.2.1690834668397; Mon, 31
Jul 2023 13:17:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 31 Jul 2023 13:17:47 -0700 (PDT)
In-Reply-To: <377a9e71-7878-42dd-a91d-2cf911d3c23bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.55; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.55
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
<00a6ddfb-2660-41b0-94d7-48a1d764577an@googlegroups.com> <0f2dce28-ac19-4613-8796-21f721eb97a6n@googlegroups.com>
<ae8bdb37-39bd-400c-aa28-8056b675d501n@googlegroups.com> <706cbf3a-4e6f-4466-a139-2511f00a7e8an@googlegroups.com>
<7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com> <377a9e71-7878-42dd-a91d-2cf911d3c23bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b8b2b81-21a7-465c-99a5-aabc8f281700n@googlegroups.com>
Subject: Re: Commandline parsing
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 31 Jul 2023 20:17:48 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1661
 by: fir - Mon, 31 Jul 2023 20:17 UTC

this last one posted looks liek a mess but its experimental and probably in future i will draw (get) some clear conclusions from this ;c (and this is also c related though for soem may not be clearly seen maybe)

Re: Commandline parsing

<c5e80b3e-d91a-4bd8-9d0a-6410eeb9424fn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26896&group=comp.lang.c#26896

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:104d:b0:63c:f3e3:8220 with SMTP id l13-20020a056214104d00b0063cf3e38220mr100372qvr.0.1690904393064;
Tue, 01 Aug 2023 08:39:53 -0700 (PDT)
X-Received: by 2002:a05:6830:1d45:b0:6b5:8a87:fc79 with SMTP id
p5-20020a0568301d4500b006b58a87fc79mr14891812oth.1.1690904392806; Tue, 01 Aug
2023 08:39:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 1 Aug 2023 08:39:52 -0700 (PDT)
In-Reply-To: <7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.224; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.224
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
<00a6ddfb-2660-41b0-94d7-48a1d764577an@googlegroups.com> <0f2dce28-ac19-4613-8796-21f721eb97a6n@googlegroups.com>
<ae8bdb37-39bd-400c-aa28-8056b675d501n@googlegroups.com> <706cbf3a-4e6f-4466-a139-2511f00a7e8an@googlegroups.com>
<7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c5e80b3e-d91a-4bd8-9d0a-6410eeb9424fn@googlegroups.com>
Subject: Re: Commandline parsing
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 01 Aug 2023 15:39:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3845
 by: fir - Tue, 1 Aug 2023 15:39 UTC

poniedziałek, 31 lipca 2023 o 21:38:02 UTC+2 fir napisał(a):
>
> some example that a;ready compiles https://fastupload.io/pakja4Guq471ngn/file
>
> input is in input.c output is in furia-output.exe
>
> it generally tends to be extremally simplified extended/modernized c 'variant' or how to call it
>
> rhe funny pieces
>
> void SetupLight
> SetPointLight 0 1 -1100.0 0.0 0.0 7000.0 50000.0 0.30 1.9 1.3 1.3 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01
> SetPointLight 1 3 1100.0 500.0 500.0 7000.0 50000.0 0.30 1.3 1.9 1.3 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01
> SetPointLight 2 3 0.0 -1500.0 -500.0 7000.0 50000.0 0.30 1.3 1.3 1.9 0.01 0.01 0.01 0.18 1.1 1.1 1.1 0.01 0.01 0.01 ;
>
> this is most simplified function definition - seems qyite okay (and it compiles so its proven to work)
>

overally it seem to showed to me today im/was to big fun of ":"
this sign is not so good, as i probably got locked in my head
(tryin to put it maybe in loops, ifs yet labels or definitions

for those ifs this seem to be not soe bad

a_pressed ? FireDotFromCameraCurrentColor 1.0 0.0 10000 20

or alternatively

a_pressed --> FireDotFromCameraCurrentColor 1.0 0.0 10000 20

(or something like that)

i think two alternatives are needed as some ifs put emphasise on question and
other on results and probably two are needed (this -> is a bit doubtfull but
something like that (elses are yet not found)

what is problematc? the underlyin if expresion

key='a' ? {}

is standable, (when expression is clearly asking this ? coud be ommited
i guess (maybe)

key='a' FireDotFromCameraCurrentColor 1.0 0.0 10000 20

but this yeilds to the problem of assigment operator, funy idea from today is that
if (as i above written to much valued ":" its free to use and in fact

a:2 is maybe even better than a=2 (here looks maybe worse but im not sure
for some points imo : is btter)

for some time i think i will toy with this idea..its not perfectly good but interesting
there is still and option to give alternative and making font producers to add good loking
sign as this : or alternatives to this

as to ask expresions there is still a problem wit them though they not look teremendously good

Re: Commandline parsing

<5d03b566-3863-4bb6-bfff-bcd067029157n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26897&group=comp.lang.c#26897

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:b683:0:b0:76a:dcfc:773a with SMTP id g125-20020a37b683000000b0076adcfc773amr48395qkf.5.1690905615169;
Tue, 01 Aug 2023 09:00:15 -0700 (PDT)
X-Received: by 2002:a9d:66cb:0:b0:6b8:8894:e4ac with SMTP id
t11-20020a9d66cb000000b006b88894e4acmr15172072otm.3.1690905614879; Tue, 01
Aug 2023 09:00:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 1 Aug 2023 09:00:14 -0700 (PDT)
In-Reply-To: <7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.224; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.224
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
<00a6ddfb-2660-41b0-94d7-48a1d764577an@googlegroups.com> <0f2dce28-ac19-4613-8796-21f721eb97a6n@googlegroups.com>
<ae8bdb37-39bd-400c-aa28-8056b675d501n@googlegroups.com> <706cbf3a-4e6f-4466-a139-2511f00a7e8an@googlegroups.com>
<7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5d03b566-3863-4bb6-bfff-bcd067029157n@googlegroups.com>
Subject: Re: Commandline parsing
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 01 Aug 2023 16:00:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1937
 by: fir - Tue, 1 Aug 2023 16:00 UTC

poniedziałek, 31 lipca 2023 o 21:38:02 UTC+2 fir napisał(a):
> what i did wrong now are loops and ifs.. i tried to simplify loops maximally
> and made it liek this
>
> 1:100: tab.add(i)
>
this is bad but maybe this is a bit better

0..100 tab add(i)

ehere .. would mean loop

...100 //loop from 0 to 100
20.. //loop form 20 to infinity
... //from 0 to infinity

all that maybe not much good but as in-way ideas its somewhat better than prevoius one

Re: Commandline parsing

<c14b00ec-3864-4a24-86d7-622a34cb1ddbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26908&group=comp.lang.c#26908

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:1934:b0:63c:f294:d89c with SMTP id es20-20020a056214193400b0063cf294d89cmr56994qvb.7.1690912195815;
Tue, 01 Aug 2023 10:49:55 -0700 (PDT)
X-Received: by 2002:a05:6870:7009:b0:1be:d373:4cd with SMTP id
u9-20020a056870700900b001bed37304cdmr9426237oae.5.1690912195473; Tue, 01 Aug
2023 10:49:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Tue, 1 Aug 2023 10:49:55 -0700 (PDT)
In-Reply-To: <5d03b566-3863-4bb6-bfff-bcd067029157n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.76; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.76
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
<00a6ddfb-2660-41b0-94d7-48a1d764577an@googlegroups.com> <0f2dce28-ac19-4613-8796-21f721eb97a6n@googlegroups.com>
<ae8bdb37-39bd-400c-aa28-8056b675d501n@googlegroups.com> <706cbf3a-4e6f-4466-a139-2511f00a7e8an@googlegroups.com>
<7e13f4c1-d070-422f-bee2-b6eae71ad98cn@googlegroups.com> <5d03b566-3863-4bb6-bfff-bcd067029157n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c14b00ec-3864-4a24-86d7-622a34cb1ddbn@googlegroups.com>
Subject: Re: Commandline parsing
From: profesor...@gmail.com (fir)
Injection-Date: Tue, 01 Aug 2023 17:49:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3316
 by: fir - Tue, 1 Aug 2023 17:49 UTC

wtorek, 1 sierpnia 2023 o 18:00:25 UTC+2 fir napisał(a):
> poniedziałek, 31 lipca 2023 o 21:38:02 UTC+2 fir napisał(a):
> > what i did wrong now are loops and ifs.. i tried to simplify loops maximally
> > and made it liek this
> >
> > 1:100: tab.add(i)
> >
> this is bad but maybe this is a bit better
>
> 0..100 tab add(i)
>
> ehere .. would mean loop
>
> ..100 //loop from 0 to 100
> 20.. //loop form 20 to infinity
> .. //from 0 to infinity
>
> all that maybe not much good but as in-way ideas its somewhat better than prevoius one

ye i could do that, though im not so eager to do teh coding right now

what i now got got yet not many things for example i nee dto write now

void DrawCloud2: 0:299: DrawAACube float(cloud2_x[i*4]) float(cloud2_y[i*4]) float(cloud2_z[i*4]) float(cloud2_r[i*4]) cloud2_color[i*4] ;;

becouse i got no multiplying index in array by, no implicit cnversions for arguments, this old syntax of loop, no structures implemented also
also i whink i will give alternative for array acces tab.i and tab.(i) which looks better often imo

so it would be into

DrawCloud2 { 0..299 { DrawAACube cloud2_x[i] cloud2_y[i] cloud2_z[i] cloud2_r[i] cloud2_color[i] }}

then into
DrawCloud2 { 0..299 { DrawAACube cloud2_x.i cloud2_y.i cloud2_z.i cloud2_r.i cloud2_color.i }}

then into (when adding structures and this what i call static binding by structure to argument names)

DrawCloud2 { 0..299 { DrawAACube cloud2.i}}
then
DrawCloud2 { DrawAACube cloud2.(0..299)}
then
DrawCloud2 { DrawAACube cloud2.()}
and then
DrawCloud2 { DrawAACube cloud2 }

the last one uses this static binding by names and array-eveluation

Re: Commandline parsing

<1ba5v95b7r.fsf@pfeifferfamily.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26956&group=comp.lang.c#26956

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pfeif...@cs.nmsu.edu (Joe Pfeiffer)
Newsgroups: comp.lang.c
Subject: Re: Commandline parsing
Date: Wed, 02 Aug 2023 16:30:16 -0600
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <1ba5v95b7r.fsf@pfeifferfamily.net>
References: <a631f98c-5482-4e90-9a0d-8ce49e447153n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ca50f9a683b96b52d9ba36043753149a";
logging-data="335987"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19CQBKVu7LF0ml0lSDWXzwIkBegZ7VW/yY="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:OVo+AEzyv/RLTa4yHQCtXNChHE0=
sha1:bb6VcdqmTAwx2AaPszemIwpLudQ=
 by: Joe Pfeiffer - Wed, 2 Aug 2023 22:30 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> Just realised that my options parser isn't publically available, which
> I have just remedied.
>
> What approaches do people use towards parsing commandline options ? Do
> you use getopt() ? Or do you find that real world programs have a
> simple enough set of options that it's easier to write bespoke code?

It depends on the complexity of the options I need to handle, and
whether or not I anticipate distributing the program to anyone but
myself.

At one extreme, just iterate through argv.
At the other, the GNU argp library.
In between, getopt().

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor