If your flag is for a path, you can assume everything up to the next flag is a path name.
myprog -filename here is my path with spaces -another_flag
Of course this depends on how the shell gives the arguments to the program.
On the other hand, there is no excuse why some GUI programs cannot handle spaces.
So, that's just one file?
Like, if someone generated several thousand files, all named: "New Text Document.txt"
In the background, some versions of Windows will also record an alternate file name for ye olde backwards compatibility, such as:
NEWTEX~1.TXT
NEWTE~10.TXT
NEWT~100.TXT
NEW~1000.TXT
NE~10000.TXT
N~100000.TXT
It's not really about the space characters, so much as it is about length constraints from back when 640KB should've been more memory than anyone will ever need.