Fix arguments parsing in the main function
Fix arguments parsing in the main function

Fixes #2611 which was a regression from 692216b86ab97db91e7ff3903ffc9ac8e37433f6.
The bogus behaviour considered that if there were more than one arguments left to parse,
they would be a pair of arguments (switch and its parameter), and thus skipped the next
argument in all cases (thus potentially skipping a "-editor", which triggered #2611).

This is fixed by checking first for arguments that don't expect a parameter, and only
afterwards for arguments that expect a parameter. And if a "pair" of arguments is not
valid, we no longer increment the counter.

mikica1986vee/godot,vkbsb/godot,Zylann/godot,MrMaidx/godot,agusbena/godot,ZuBsPaCe/godot,iap-mutant/godot,akien-mga/godot,teamblubee/godot,ficoos/godot,BastiaanOlij/godot,quabug/godot,godotengine/godot,teamblubee/godot,Marqin/godot,BastiaanOlij/godot,JoshuaGrams/godot,n-pigeon/godot,Valentactive/godot,akien-mga/godot,ex/godot,ageazrael/godot,shackra/godot,MrMaidx/godot,okamstudio/godot,BastiaanOlij/godot,exabon/godot,Zylann/godot,Brickcaster/godot,MarianoGnu/godot,DmitriySalnikov/godot,dreamsxin/godot,RebelliousX/Go_Dot,jejung/godot,crr0004/godot,groud/godot,mikica1986vee/Godot_android_tegra_fallback,mcanders/godot,iap-mutant/godot,JoshuaGrams/godot,FateAce/godot,FateAce/godot,RandomShaper/godot,okamstudio/godot,MarianoGnu/godot,Marqin/godot,vnen/godot,JoshuaGrams/godot,huziyizero/godot,mikica1986vee/Godot_android_tegra_fallback,RebelliousX/Go_Dot,sanikoyes/godot,Faless/godot,mcanders/godot,teamblubee/godot,guilhermefelipecgs/godot,ageazrael/godot,Shockblast/godot,Hodes/godot,vnen/godot,josempans/godot,godotengine/godot,godotengine/godot,kimsunzun/godot,NateWardawg/godot,dreamsxin/godot,mcanders/godot,shackra/godot,pixelpicosean/my-godot-2.1,quabug/godot,DmitriySalnikov/godot,NateWardawg/godot,NateWardawg/godot,kimsunzun/godot,FateAce/godot,ex/godot,mikica1986vee/Godot_android_tegra_fallback,DmitriySalnikov/godot,tomreyn/godot,NateWardawg/godot,est31/godot,honix/godot,guilhermefelipecgs/godot,mrezai/godot,firefly2442/godot,tomreyn/godot,josempans/godot,kimsunzun/godot,vnen/godot,RebelliousX/Go_Dot,MrMaidx/godot,a12n/godot,Paulloz/godot,azurvii/godot,groud/godot,MarianoGnu/godot,okamstudio/godot,mikica1986vee/Godot_android_tegra_fallback,BastiaanOlij/godot,morrow1nd/godot,ianholing/godot,Max-Might/godot,MrMaidx/godot,godotengine/godot,mikica1986vee/Godot_android_tegra_fallback,blackwc/godot,iap-mutant/godot,blackwc/godot,Zylann/godot,blackwc/godot,ianholing/godot,est31/godot,gau-veldt/godot,firefly2442/godot,ex/godot,Brickcaster/godot,firefly2442/godot,rollenrolm/godot,vnen/godot,quabug/godot,firefly2442/godot,honix/godot,MarianoGnu/godot,exabon/godot,kimsunzun/godot,buckle2000/godot,Paulloz/godot,rollenrolm/godot,shackra/godot,opmana/godot,quabug/godot,gau-veldt/godot,quabug/godot,Valentactive/godot,Paulloz/godot,JoshuaGrams/godot,firefly2442/godot,vkbsb/godot,okamstudio/godot,mcanders/godot,Brickcaster/godot,mikica1986vee/godot,Hodes/godot,morrow1nd/godot,dreamsxin/godot,akien-mga/godot,ianholing/godot,dreamsxin/godot,dreamsxin/godot,okamstudio/godot,OpenSocialGames/godot,guilhermefelipecgs/godot,zicklag/godot,honix/godot,crr0004/godot,a12n/godot,Zylann/godot,josempans/godot,Max-Might/godot,mikica1986vee/godot,crr0004/godot,morrow1nd/godot,kimsunzun/godot,ianholing/godot,BastiaanOlij/godot,quabug/godot,ianholing/godot,jejung/godot,Valentactive/godot,Valentactive/godot,TheHX/godot,crr0004/godot,iap-mutant/godot,guilhermefelipecgs/godot,a12n/godot,OpenSocialGames/godot,vkbsb/godot,gau-veldt/godot,akien-mga/godot,mikica1986vee/godot,mikica1986vee/godot,Zylann/godot,ageazrael/godot,pixelpicosean/my-godot-2.1,n-pigeon/godot,azurvii/godot,dreamsxin/godot,blackwc/godot,Shockblast/godot,mrezai/godot,vnen/godot,buckle2000/godot,honix/godot,crr0004/godot,vkbsb/godot,sanikoyes/godot,pkowal1982/godot,exabon/godot,zicklag/godot,honix/godot,ZuBsPaCe/godot,vkbsb/godot,OpenSocialGames/godot,zicklag/godot,josempans/godot,ex/godot,n-pigeon/godot,opmana/godot,rollenrolm/godot,ianholing/godot,DmitriySalnikov/godot,okamstudio/godot,huziyizero/godot,JoshuaGrams/godot,ZuBsPaCe/godot,shackra/godot,dreamsxin/godot,sanikoyes/godot,morrow1nd/godot,Paulloz/godot,vnen/godot,MarianoGnu/godot,quabug/godot,Paulloz/godot,est31/godot,a12n/godot,opmana/godot,mikica1986vee/godot,a12n/godot,n-pigeon/godot,zicklag/godot,mikica1986vee/Godot_android_tegra_fallback,Paulloz/godot,NateWardawg/godot,firefly2442/godot,firefly2442/godot,Valentactive/godot,groud/godot,gau-veldt/godot,azurvii/godot,morrow1nd/godot,shackra/godot,a12n/godot,Faless/godot,RandomShaper/godot,ficoos/godot,n-pigeon/godot,ficoos/godot,vnen/godot,JoshuaGrams/godot,Faless/godot,a12n/godot,rollenrolm/godot,mikica1986vee/Godot_android_tegra_fallback,FateAce/godot,mikica1986vee/Godot_android_tegra_fallback,guilhermefelipecgs/godot,RebelliousX/Go_Dot,ageazrael/godot,blackwc/godot,pkowal1982/godot,josempans/godot,godotengine/godot,Faless/godot,teamblubee/godot,tomreyn/godot,NateWardawg/godot,akien-mga/godot,mrezai/godot,iap-mutant/godot,MrMaidx/godot,groud/godot,okamstudio/godot,pixelpicosean/my-godot-2.1,mikica1986vee/godot,jejung/godot,OpenSocialGames/godot,pkowal1982/godot,Faless/godot,exabon/godot,Shockblast/godot,mikica1986vee/godot,tomreyn/godot,sanikoyes/godot,a12n/godot,n-pigeon/godot,firefly2442/godot,NateWardawg/godot,teamblubee/godot,godotengine/godot,mikica1986vee/godot,ficoos/godot,OpenSocialGames/godot,shackra/godot,agusbena/godot,shackra/godot,pkowal1982/godot,Shockblast/godot,Max-Might/godot,agusbena/godot,agusbena/godot,Hodes/godot,Brickcaster/godot,teamblubee/godot,ianholing/godot,a12n/godot,dreamsxin/godot,okamstudio/godot,crr0004/godot,Shockblast/godot,Paulloz/godot,dreamsxin/godot,ficoos/godot,azurvii/godot,morrow1nd/godot,ZuBsPaCe/godot,Brickcaster/godot,DmitriySalnikov/godot,Zylann/godot,TheHX/godot,huziyizero/godot,quabug/godot,tomreyn/godot,buckle2000/godot,sanikoyes/godot,shackra/godot,NateWardawg/godot,mikica1986vee/Godot_android_tegra_fallback,Marqin/godot,kimsunzun/godot,mrezai/godot,a12n/godot,ex/godot,vnen/godot,godotengine/godot,DmitriySalnikov/godot,zicklag/godot,mrezai/godot,MrMaidx/godot,pixelpicosean/my-godot-2.1,sanikoyes/godot,BastiaanOlij/godot,RandomShaper/godot,Shockblast/godot,Shockblast/godot,groud/godot,azurvii/godot,mrezai/godot,mikica1986vee/Godot_android_tegra_fallback,MarianoGnu/godot,kimsunzun/godot,ZuBsPaCe/godot,pkowal1982/godot,vkbsb/godot,RandomShaper/godot,iap-mutant/godot,josempans/godot,RandomShaper/godot,mcanders/godot,iap-mutant/godot,est31/godot,mikica1986vee/godot,rollenrolm/godot,akien-mga/godot,josempans/godot,OpenSocialGames/godot,Valentactive/godot,OpenSocialGames/godot,kimsunzun/godot,RandomShaper/godot,crr0004/godot,Zylann/godot,teamblubee/godot,FateAce/godot,kimsunzun/godot,n-pigeon/godot,okamstudio/godot,shackra/godot,NateWardawg/godot,guilhermefelipecgs/godot,Brickcaster/godot,Hodes/godot,Brickcaster/godot,agusbena/godot,honix/godot,OpenSocialGames/godot,pkowal1982/godot,Max-Might/godot,huziyizero/godot,ageazrael/godot,Marqin/godot,iap-mutant/godot,jejung/godot,guilhermefelipecgs/godot,vkbsb/godot,Hodes/godot,mcanders/godot,ZuBsPaCe/godot,quabug/godot,blackwc/godot,iap-mutant/godot,agusbena/godot,exabon/godot,ficoos/godot,TheHX/godot,exabon/godot,blackwc/godot,RebelliousX/Go_Dot,Max-Might/godot,shackra/godot,mrezai/godot,TheHX/godot,josempans/godot,akien-mga/godot,ageazrael/godot,ianholing/godot,crr0004/godot,TheHX/godot,azurvii/godot,Faless/godot,teamblubee/godot,buckle2000/godot,pkowal1982/godot,est31/godot,BastiaanOlij/godot,ZuBsPaCe/godot,gau-veldt/godot,ex/godot,agusbena/godot,vkbsb/godot,huziyizero/godot,MarianoGnu/godot,buckle2000/godot,Max-Might/godot,crr0004/godot,Hodes/godot,Valentactive/godot,OpenSocialGames/godot,Valentactive/godot,opmana/godot,Faless/godot,Shockblast/godot,buckle2000/godot,okamstudio/godot,Marqin/godot,RandomShaper/godot,Zylann/godot,ianholing/godot,mrezai/godot,kimsunzun/godot,guilhermefelipecgs/godot,groud/godot,ex/godot,ZuBsPaCe/godot,blackwc/godot,sanikoyes/godot,ageazrael/godot,blackwc/godot,ex/godot,DmitriySalnikov/godot,agusbena/godot,teamblubee/godot,jejung/godot,godotengine/godot,blackwc/godot,pkowal1982/godot,quabug/godot,teamblubee/godot,zicklag/godot,jejung/godot,pixelpicosean/my-godot-2.1,ianholing/godot,FateAce/godot,akien-mga/godot,MarianoGnu/godot,sanikoyes/godot,RebelliousX/Go_Dot,OpenSocialGames/godot,Marqin/godot,est31/godot,iap-mutant/godot,dreamsxin/godot,crr0004/godot,opmana/godot,BastiaanOlij/godot,Faless/godot