Command line arguments
woody%Juliet.Caltech.Edu at cit-hamlet.ARPA
woody%Juliet.Caltech.Edu at cit-hamlet.ARPA
Sun Mar 9 12:35:24 AEST 1986
For those who may be interested in such things as Icon-driven
environments, this is what the Macintosh computer does under the Macintosh
Megamax C compiler: (other implementations may vary)
When you double click a program icon, the file name of the program
gets passed to the C program through argc/argv; when you shift click some
documents before double clicking a program icon (thereby telling the program
to use those documents), the names of the documents get passed to the
C program through argc/argv--one document name for every element in argv[].
And when you shift click some documents, select a program, and select
the "Print" option from one of the Finder (read: Macintosh shell) menus,
the argument "-p" gets passed to the C program in argv[].
So, the Macintosh does support passing arguments to the program;
however, it's not as flexible as a command line entry under the Unix shell
where command line arguments may be just about any arbitrary string.
- William Woody
NET Woody%Romeo at Hamlet.Caltech.Edu
USNAIL 1-54 Lloyd, Caltech / Pasadena, CA 91126
More information about the Comp.lang.c
mailing list