arg$=GetRawCommandLine()

Feature requests for future versions of Hollywood can be voiced here
Post Reply
NathanH
Posts: 128
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

arg$=GetRawCommandLine()

Post by NathanH »

I've been sitting on this for a few years now. Is it possible to get the command line as a string with no parsing/help from Hollywood/C/DOS/whatever? GetRawArguments() reads the greater-than sign as redirection rather than passing it as an argument. I need to capture and process everything myself including any redirection. GetCommandLine() doesn't get the command line either, instead it parses arguments. As a work around I use GetFileArgument() with quotes because everything between quotes is passed to my programs unchanged and unparsed. That means however, the user has to put quotes around anything with more than one argument and can't place quotes within the quotes. The work-around for that is to instruct the user to use "`" (grave) as pretend quotes. Thanks.

NathanH
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: arg$=GetRawCommandLine()

Post by plouf »

imho redirection and special characters pipe handling, are captured by OS , and program never access them.

workarounds like the one you use is only way

Also if the user types itself command line, and not passign them via "Execute()" of another script for exampleyou can use s$ = ReadConsoleStr()
another common use way is to write it to a file, and then read that file

etc
Christos
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: arg$=GetRawCommandLine()

Post by airsoftsoftwair »

Plouf is right, it's not possible because things like pipe redirections are handled by the shell and programs have no clue about this. GetRawCommandLine() really is as raw as it gets, it returns directly what the shell passes to your program. Programs written in other languages like C can't get more than that either.
NathanH
Posts: 128
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: arg$=GetRawCommandLine()

Post by NathanH »

Thanks, I was thinking that may be the case.

NathanH
Post Reply