list possible arguments / options for applications

How can I list possible arguments / options for applications to use with the 'open' command from the terminal


I use the terminal / command line a lot, also the open command, for example

open http://some.url -a Firefox

and so on.


one can also pass arguments to the application one is going to open like

open http://some.url -a Firefox --args <everything-here-will-be-passed-to-the-ff-application>


but to really use this feature I need to know which arguments I could pass the the application.


so, is there a way to get this information?


something like:

open /Applications/some.app --args --help

doesn't work.....

MacBook Pro (Retina, 13-inch, Late 2012)

Posted on Oct 10, 2017 11:13 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 11, 2017 7:46 AM

From a Terminal session:

/Applications/Firefox.app/Contents/MacOS/Firefox --help

Usage: firefox [ options ... ] [URL]

where options include:


--g-fatal-warnings Make all warnings fatal


Firefox options

-h or --help Print this message.

-v or --version Print Firefox version.

-P <profile> Start with <profile>.

--profile <path> Start with profile at <path>.

--migration Start with migration wizard.

--ProfileManager Start with ProfileManager.

--no-remote Do not accept or send remote commands; implies

--new-instance.

--new-instance Open new instance, not a new window in running instance.

--UILocale <locale> Start with <locale> resources as UI Locale.

--safe-mode Disables extensions and themes for this session.

--marionette Enable remote control server.

--browser Open a browser window.

--new-window <url> Open <url> in a new window.

--new-tab <url> Open <url> in a new tab.

--private-window <url> Open <url> in a new private window.

--preferences Open Preferences dialog.

--search <term> Search <term> with your default search engine.

--jsconsole Open the Browser Console.

--jsdebugger Open the Browser Toolbox.

--wait-for-jsdebugger Spin event loop until JS debugger connects.

Enables debugging (some) application startup code paths.

Only has an effect when `--jsdebugger` is also supplied.

--devtools Open DevTools on initial load.

--start-debugger-server [ws:][ <port> | <path> ] Start the debugger server on

a TCP port or Unix domain socket path. Defaults to TCP port

6000. Use WebSocket protocol if ws: prefix is specified.

--recording <file> Record drawing for a given URL.

--recording-output <file> Specify destination file for a drawing recording.

--setDefaultBrowser Set this app as the default browser.

NOTE: This trick will NOT work for all apps. Firefox most likely works because it also has a Unix/Linux based version.


But it is worth trying:

app_name.app/Contents/MacOS/app_name --help

app_name.app/Contents/MacOS/app_name -h

If that doesn't work, then

strings app_name.app/Contents/MacOS/app_name >/tmp/tmp.txt

less /tmp/tmp.txt

and see if you can find an -something or --something strings that might hint at an option.


Then again, the option strings might be internationalized, so 'strings' may not find anything, as all the option names may be in the various language specific Resources files

3 replies
Question marked as Top-ranking reply

Oct 11, 2017 7:46 AM in response to torstello

From a Terminal session:

/Applications/Firefox.app/Contents/MacOS/Firefox --help

Usage: firefox [ options ... ] [URL]

where options include:


--g-fatal-warnings Make all warnings fatal


Firefox options

-h or --help Print this message.

-v or --version Print Firefox version.

-P <profile> Start with <profile>.

--profile <path> Start with profile at <path>.

--migration Start with migration wizard.

--ProfileManager Start with ProfileManager.

--no-remote Do not accept or send remote commands; implies

--new-instance.

--new-instance Open new instance, not a new window in running instance.

--UILocale <locale> Start with <locale> resources as UI Locale.

--safe-mode Disables extensions and themes for this session.

--marionette Enable remote control server.

--browser Open a browser window.

--new-window <url> Open <url> in a new window.

--new-tab <url> Open <url> in a new tab.

--private-window <url> Open <url> in a new private window.

--preferences Open Preferences dialog.

--search <term> Search <term> with your default search engine.

--jsconsole Open the Browser Console.

--jsdebugger Open the Browser Toolbox.

--wait-for-jsdebugger Spin event loop until JS debugger connects.

Enables debugging (some) application startup code paths.

Only has an effect when `--jsdebugger` is also supplied.

--devtools Open DevTools on initial load.

--start-debugger-server [ws:][ <port> | <path> ] Start the debugger server on

a TCP port or Unix domain socket path. Defaults to TCP port

6000. Use WebSocket protocol if ws: prefix is specified.

--recording <file> Record drawing for a given URL.

--recording-output <file> Specify destination file for a drawing recording.

--setDefaultBrowser Set this app as the default browser.

NOTE: This trick will NOT work for all apps. Firefox most likely works because it also has a Unix/Linux based version.


But it is worth trying:

app_name.app/Contents/MacOS/app_name --help

app_name.app/Contents/MacOS/app_name -h

If that doesn't work, then

strings app_name.app/Contents/MacOS/app_name >/tmp/tmp.txt

less /tmp/tmp.txt

and see if you can find an -something or --something strings that might hint at an option.


Then again, the option strings might be internationalized, so 'strings' may not find anything, as all the option names may be in the various language specific Resources files

Oct 11, 2017 4:49 AM in response to torstello

I recommend that you drop into the Terminal and read the man page for open(1). Just because it offers an --args switch to pass optional arguments to applications, does not mean that the specific application is designed to accept them. Firefox is the exception, not the rule, and most graphical applications, including all of Apple's Cocoa-based applications, ignore the open --args arguments. The individual developer site will share, what, if any, command-line arguments that their graphical application may accept. Or they may not.


Some graphical applications may provide a separate command-line tool in their .app bundle that is run directly in the Terminal, and these accept their own arguments. Sublime Text 3, BBEdit, MacVIM, Open/LibreOffice, Inkscape, and Calibre are examples. These are not used with the open command.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

list possible arguments / options for applications

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.