Separar los argumentos de la línea de comando del intérprete de los argumentos del script

Suppose you have an interpreter that takes command line arguments including the filenames for a script to be run, and optionally further arguments to be passed to the script. The interpreter then needs to figure out which of the given arguments were intended for its own use and which were intended to be passed to the script.

Is there a widely used convention for separating the former from the latter?

preguntado el 05 de mayo de 13 a las 14:05

2 Respuestas

With Bash

 --        A -- signals the end of options and disables  further  option
           processing.   Any arguments after the -- are treated as file-
           names and arguments.  An argument of - is equivalent to --.

contestado el 05 de mayo de 13 a las 15:05

Con CMD :: is often used as a dummy argument to indicate recusrsion for instance. Prefixed on a line, it can be used to turn the line into a comment, giving a handy "programmed-skip" facility

contestado el 06 de mayo de 13 a las 01:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.