Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
ArgumentsOptions
  • See Also
    • CheckArguments
    • Options
    • OptionValue
    • OptionsPattern
  • Related Guides
    • Options Management
    • Package Development
    • Package Bulletproofing
    • Robustness & Error Handling
  • Workflows
    • Define a Function with Options
  • Tech Notes
    • Setting Up Functions with Optional Arguments
    • Manipulating Options
    • See Also
      • CheckArguments
      • Options
      • OptionValue
      • OptionsPattern
    • Related Guides
      • Options Management
      • Package Development
      • Package Bulletproofing
      • Robustness & Error Handling
    • Workflows
      • Define a Function with Options
    • Tech Notes
      • Setting Up Functions with Optional Arguments
      • Manipulating Options

ArgumentsOptions[f[args],n]

tries to separate args into a list of n positional arguments followed by a list of valid options for f.

ArgumentsOptions[f[args],{min,max}]

requires the number of positional arguments to be between min and max.

ArgumentsOptions[f[args],spec,assoc]

modifies the behavior based on the information in the association assoc.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Applications  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides
Related Workflows
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • CheckArguments
    • Options
    • OptionValue
    • OptionsPattern
  • Related Guides
    • Options Management
    • Package Development
    • Package Bulletproofing
    • Robustness & Error Handling
  • Workflows
    • Define a Function with Options
  • Tech Notes
    • Setting Up Functions with Optional Arguments
    • Manipulating Options
    • See Also
      • CheckArguments
      • Options
      • OptionValue
      • OptionsPattern
    • Related Guides
      • Options Management
      • Package Development
      • Package Bulletproofing
      • Robustness & Error Handling
    • Workflows
      • Define a Function with Options
    • Tech Notes
      • Setting Up Functions with Optional Arguments
      • Manipulating Options

ArgumentsOptions

ArgumentsOptions[f[args],n]

tries to separate args into a list of n positional arguments followed by a list of valid options for f.

ArgumentsOptions[f[args],{min,max}]

requires the number of positional arguments to be between min and max.

ArgumentsOptions[f[args],spec,assoc]

modifies the behavior based on the information in the association assoc.

Details

  • ArgumentsOptions issues appropriate messages for f and returns a Failure object if f[…] has the wrong number of positional arguments, unknown options or invalid option specifications.
  • The following keys can be used for the association assoc:
  • "ExtraOptions"{}additional options to treat as known options for f
    "OptionsMode""Longest"how to interpret the optional positional arguments of args
    "Head"Listwrapper for the positional arguments and options lists
  • Additional options given to "ExtraOptions" can be specified as rules nameval or as symbols func, which is equivalent to Options[func].
  • ArgumentsOptions checks whether all options specified for f have valid names.
  • The following values of "OptionsMode" can be used: »
  • "Longest"treat all trailing elements of args matching OptionsPattern[] as options for f
    "Shortest"treat anything other than one or more known options as positional arguments
    Nonetreat all elements as positional arguments
  • Even with "OptionsMode""Shortest", an unknown option past position max still generates a message. »
  • ArgumentsOptions has the attribute HoldFirst.

Examples

open all close all

Basic Examples  (1)

Declare the options of the function f:

Wolfram Language code: Options[f] = {a -> 1}

Separate the arguments to f into exactly one positional argument and options:

Wolfram Language code: ArgumentsOptions[f[1, a -> 0], 1]

Appropriate messages are issued if the arguments to f are invalid:

Wolfram Language code: ArgumentsOptions[f[1, 2], 1]

Scope  (7)

Separate the positional arguments and options for a function that takes between 1 and 3 positional arguments:

Wolfram Language code: Options[f] = {a -> 1}
Wolfram Language code: ArgumentsOptions[f[1, 2, a -> 3], {1, 3}]

Require at least 2 positional arguments:

Wolfram Language code: ArgumentsOptions[f[1, 2, 3], {2, ∞}]

Calling f with 1 argument is invalid:

Wolfram Language code: ArgumentsOptions[f[1], {2, ∞}]

Require exactly 3 positional arguments:

Wolfram Language code: Options[f] = {a -> 1, b -> 2}
Wolfram Language code: ArgumentsOptions[f[1, 2, 3, a -> 0, b -> 0], 3]

Allow "hidden" options that do not appear in Options[f]:

Wolfram Language code: ArgumentsOptions[f[1, a -> 0], 1, <|"ExtraOptions" -> {a -> 1}|>]

The option a0 is not a known option for f:

Wolfram Language code: Options[f]

Allow the option named hidden as well as any option of Graphics to be set:

Wolfram Language code: Options[f] = {normal -> Automatic}
Wolfram Language code: ArgumentsOptions[f[1, normal -> 3, hidden -> 2, AspectRatio -> 1], {1, 2}, <|"ExtraOptions" -> {hidden -> 0, Graphics}|>]

Treat unknown trailing options in positions min+1 though max as positional arguments rather than options for f:

Wolfram Language code: Options[f] = {a -> 1}

The rule b1 is treated as a positional argument:

Wolfram Language code: ArgumentsOptions[f[1, b -> 2, a -> 3], {1, 2}, <|"OptionsMode" -> "Shortest"|>]

With the default "OptionsMode""Longest", a message is issued for unknown options:

Wolfram Language code: ArgumentsOptions[f[1, b -> 2, a -> 3], {1, 2}, <|"OptionsMode" -> "Longest"|>]

A known option is still treated as an option for f with "OptionsMode""Shortest":

Wolfram Language code: ArgumentsOptions[f[1, a -> 2], {1, 2}, <|"OptionsMode" -> "Shortest"|>]

Treat all elements as positional arguments rather than options for f:

Wolfram Language code: ArgumentsOptions[f[1, a -> 2], {1, 2}, <|"OptionsMode" -> None|>]

Separate the arguments without evaluating them:

Wolfram Language code: ArgumentsOptions[f[2 + 2, 3 * 3, a -> 4 ^ 4], 2, <|"Head" -> Hold, "ExtraOptions" -> {a -> 0}|>]

Applications  (2)

Define a function that calls a helper function if called with one or two positional arguments:

Wolfram Language code: Options[f] = {a -> 1}
Wolfram Language code: f[args___] := Block[{sep}, sep = ArgumentsOptions[f[args], {1, 2}]; g[sep] /; !FailureQ[sep] ]
Wolfram Language code: g[{argList_, optList_}] := Switch[Length[argList], 1, First[argList] + OptionValue[f, optList, a], 2, argList + OptionValue[f, optList, a] ]

When called with one or two positional arguments, the helper function is called:

Wolfram Language code: f[3, a -> 4]
Wolfram Language code: f[3, 4, a -> 5]

When called with more than two positional arguments, f returns unevaluated and issues a message:

Wolfram Language code: f[1, 2, 3]

Use "OptionsMode""Shortest" to treat trailing empty lists as positional arguments:

Wolfram Language code: Options[f] = {a -> b}
Wolfram Language code: ArgumentsOptions[f[a, {}, {}, {}], {1, 3}, <|"OptionsMode" -> "Shortest"|>]

Properties & Relations  (10)

ArgumentsOptions[f[…],…] issues a message and returns Failure[…] for invalid input to f:

Wolfram Language code: Options[f] = {a -> 1}
Wolfram Language code: ArgumentsOptions[f[1, 2], 3]
Wolfram Language code: ArgumentsOptions[f[0, b -> 2], 1]

If f does not accept options, all arguments are assumed to be positional:

Wolfram Language code: Options[f]
Wolfram Language code: ArgumentsOptions[f[0, b -> 2], {1, 2}]

Options are always returned as a flat list, irrespective of how they appeared in the input expression:

Wolfram Language code: Options[f] = {a -> 1, b -> 2, c -> 3}
Wolfram Language code: ArgumentsOptions[f[x, a -> 0, {b -> 5, {{c -> 17}}}], 1]

ArgumentsOptions[…,{min,max}] will always treat the first min arguments as positional:

Wolfram Language code: Options[f] = {a -> 1}

Here, even though a0 matches OptionsPattern[], it is treated as a positional argument:

Wolfram Language code: ArgumentsOptions[f[1, a -> 0], {2, 3}]

If the rule a0 is given after the positional arguments, it is treated as an option:

Wolfram Language code: ArgumentsOptions[f[1, 2, a -> 0], {2, 3}]

Only trailing options are considered when collecting options:

Wolfram Language code: Options[f] = {a -> 1, b -> 2, c -> 3}
Wolfram Language code: ArgumentsOptions[f[x, a -> 5, y, b -> 7, c -> 11], {1, 4}]

Trailing rules matching OptionsPattern[] are treated as options if they are known options for f:

Wolfram Language code: Options[f] = {a -> 1, b -> 2}

This is true even if "OptionsMode""Shortest" is given:

Wolfram Language code: ArgumentsOptions[f[1, a -> 0, b -> 0], {1, 2}, <|"OptionsMode" -> "Shortest"|>]

An option specification that contains both known and unknown options generates a message:

Wolfram Language code: Options[f] = {a -> 1}
Wolfram Language code: ArgumentsOptions[f[1, {a -> 2, b -> 3}], 1]

In "OptionsMode""Shortest", a list with known and unknown options is treated as a positional argument if possible:

Wolfram Language code: Options[f] = {a -> 1}
Wolfram Language code: ArgumentsOptions[f[1, {a -> 2, b -> 3}], {1, 2}, <|"OptionsMode" -> "Shortest"|>]

An unknown option past the maximum number of positional arguments still generates a message:

Wolfram Language code: ArgumentsOptions[f[1, 2, {a -> 2, b -> 3}], {1, 2}, <|"OptionsMode" -> "Shortest"|>]

Only rules matching OptionsPattern[] can be valid option specifications:

Wolfram Language code: Options[f] = {a -> 1}

The rule 12 does not match OptionsPattern[]:

Wolfram Language code: MatchQ[1 -> 2, OptionsPattern[]]

Thus it is treated as a positional argument:

Wolfram Language code: ArgumentsOptions[f[1 -> 2], {0, 1}]

If 12 is given after the positional arguments, it is treated as an invalid option specification:

Wolfram Language code: ArgumentsOptions[f[0, 1 -> 2], {0, 1}]

ArgumentsOptions returns Failure[…] when CheckArguments returns False:

Wolfram Language code: ArgumentsOptions[f[], 1]
Wolfram Language code: CheckArguments[f[], 1]

Possible Issues  (3)

If f accepts options, trailing empty lists are ignored by default because {} matches OptionsPattern[]:

Wolfram Language code: Options[f] = {a -> 1}
Wolfram Language code: ArgumentsOptions[f[1, 2, {}], {2, 3}]

Use "OptionsMode""Shortest" to treat a trailing empty list as a positional argument:

Wolfram Language code: ArgumentsOptions[f[1, 2, {}], {2, 3}, <|"OptionsMode" -> "Shortest"|>]

All arguments at or before the minimum argument count are considered positional arguments:

Wolfram Language code: ArgumentsOptions[StringCases["str", IgnoreCase -> True, Overlaps -> True], {2, 3}]

ArgumentsOptions does not check whether the option values are correct:

Wolfram Language code: ArgumentsOptions[Map[f, x, Heads -> ∞], {2, 3}]

Infinity is not a valid value for Heads:

Wolfram Language code: Map[f, x, Heads -> ∞]

See Also

CheckArguments  Options  OptionValue  OptionsPattern

Tech Notes

    ▪
  • Setting Up Functions with Optional Arguments
  • ▪
  • Manipulating Options

Related Guides

    ▪
  • Options Management
  • ▪
  • Package Development
  • ▪
  • Package Bulletproofing
  • ▪
  • Robustness & Error Handling

Related Workflows

    Related Workflows
    ▪
  • Define a Function with Options

History

Introduced in 2020 (12.2) | Updated in 2024 (14.0)

Wolfram Research (2020), ArgumentsOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/ArgumentsOptions.html (updated 2024).

Text

Wolfram Research (2020), ArgumentsOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/ArgumentsOptions.html (updated 2024).

CMS

Wolfram Language. 2020. "ArgumentsOptions." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/ArgumentsOptions.html.

APA

Wolfram Language. (2020). ArgumentsOptions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArgumentsOptions.html

BibTeX

@misc{reference.wolfram_2026_argumentsoptions, author="Wolfram Research", title="{ArgumentsOptions}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/ArgumentsOptions.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_argumentsoptions, organization={Wolfram Research}, title={ArgumentsOptions}, year={2024}, url={https://reference.wolfram.com/language/ref/ArgumentsOptions.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English