flat assembler
Message board for the users of flat assembler.

Index > Linux > treating of "--" option

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Mar 2007, 18:28
hi, doesn't anyone know what is "standard" treating of "--" option?

I found out that "-" is taken as filename ("cp file -", "ls -", etc..).

But i failed to understand what is "--".
Post 22 Mar 2007, 18:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 22 Mar 2007, 18:50

_________________
lscr::winstuff
Post 22 Mar 2007, 18:50
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Mar 2007, 19:20
very good article, thanks.

However, i am not much smarter now:
Quote:
The special argument '--' indicates the end of all options. Any subsequent arguments on the command line are treated as operands, even if they begin with a dash.

what "operands"? could you give some example please?
Post 22 Mar 2007, 19:20
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel 22 Mar 2007, 19:40
Suppose 'app' executes '/bin/ls':

./app -a -- /bin/ls -l

'-a' will be treated as an option by app, but '-l' will be passed to ls.
Post 22 Mar 2007, 19:40
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Mar 2007, 19:45
got it, thanks.

so everything behind "--" should be treated literary... thanks
Post 22 Mar 2007, 19:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 22 Mar 2007, 22:51
...including opening a file starting with a dash without prefixing with ./
Post 22 Mar 2007, 22:51
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Mar 2007, 23:11
f0dder: doesn't matter for me. My library will only process args meant for current application, eg. only up to "--"
Post 22 Mar 2007, 23:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.