Menu

#403 4.20: Command line error: filename begins with minus

open
nobody
None
5
2012-12-07
2005-06-23
Anonymous
No

Hello. Thank you for the nice archiver!

This is the listing from stdout:
---------

7za a -t7z arc -file.txt -r0 -m0=LZMA:d8m -mx=9 -ma=2
-y

Error:
Incorrect command line

---------
It seems to me that the incorrection happened because
the file name begins with the minus. When I had added
quotes around -file.txt it didn't work as well. Is it a
feature or a bug?

Discussion

  • Nobody/Anonymous

    Logged In: NO

    pdreyer@hotmail.com

    Use two minus signs to signal the end of switches

    e.g.
    D:\tmp> 7z a -mx=9 -- sfile.7z -sqldps.rpt

    7-Zip 4.23 Copyright (c) 1999-2005 Igor Pavlov 2005-06-29
    Scanning

    Creating archive sfile.7z

    Compressing -sqldps.rpt

    Everything is Ok

    D:\tmp> 7z l sfile.7z

    7-Zip 4.23 Copyright (c) 1999-2005 Igor Pavlov 2005-06-29

    Listing archive: sfile.7z

    Date Time Attr Size Compressed Name
    ------------------- ----- ------------ ------------ -----------
    2005-07-05 09:33:43 ....A 10305 1209 -sqldps.rpt
    ------------------- ----- ------------ ------------ -----------
    10305 1209 1 files

     
  • Igor Pavlov

    Igor Pavlov - 2005-07-22

    Logged In: YES
    user_id=65083

    7za a -t7z arc -r0 -m0=LZMA:d8m -mx=9 -ma=2
    -y -- -file.txt

     

Log in to post a comment.