Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the names of options for a function, possibly filtered according to a pattern
| ResourceFunction["OptionNames"][symbol] gives the names of options assigned to a symbol. | |
| ResourceFunction["OptionNames"][symbol,patt] gives the names of options that match the pattern patt. | 
| IgnoreCase | False | match regardless of case | 
| SpellingCorrection | False | allow small differences to match | 
Get the names of options to Plot, without their default values:
| In[1]:= | ![ResourceFunction["OptionNames"][Plot]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/257c9df8a7526597.png) | 
| Out[1]= |  | 
Get the names of options related to PlotRange:
| In[2]:= | ![ResourceFunction["OptionNames"][Plot, "PlotRange*"]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/34dd291435a4270e.png) | 
| Out[2]= |  | 
Find option names even if the case is different:
| In[5]:= | ![ResourceFunction["OptionNames"][Plot, "plotrange*", IgnoreCase -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/0424deae6aaf736f.png) | 
| Out[5]= |  | 
Find option names even if the spelling is incorrect:
| In[6]:= | ![ResourceFunction["OptionNames"][Plot, "PlotRagne", SpellingCorrection -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/75d410bc98c6069c.png) | 
| Out[6]= |  | 
Find the options shared by Plot and NIntegrate:
| In[7]:= | ![Intersection[ResourceFunction["OptionNames"][Plot], ResourceFunction["OptionNames"][NIntegrate]]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/7152c2f58a0b554e.png) | 
| Out[7]= |  | 
Using Options instead of OptionNames misses Exclusions because it has different default values:
| In[8]:= | ![Intersection[Options[Plot], Options[NIntegrate]]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/784bdd45bbe8e593.png) | 
| Out[8]= |  | 
| In[9]:= | ![{Options[Plot, Exclusions], Options[NIntegrate, Exclusions]}](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/1ae05bac4fdc782f.png) | 
| Out[9]= |  | 
Option names are returned in their original form:
| In[10]:= | ![Options[foo] = {aaaSymbol -> True, "aaaString" -> True, bbb -> False};](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/3fb1a63b16552142.png) | 
| In[11]:= | ![InputForm[ResourceFunction["OptionNames"][foo, "aaa*"]]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/0e1d1df39bbb82ac.png) | 
| Out[11]= |  | 
Spelling correction only works for literal patterns:
| In[12]:= | ![ResourceFunction["OptionNames"][Plot, "PlotRagne*", SpellingCorrection -> True]](https://www.wolframcloud.com/obj/resourcesystem/images/4a4/4a4cc5ae-d18f-4d36-bfd1-a88f5de0b80a/172245abf50dcfda.png) | 
| Out[12]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License