[Chapel Merge] This PR adds positional arguments to the argument

Branch: refs/heads/main
Revision: 6288a4f
Author: arezaii
Log Message:

Merge pull request #18196 from arezaii/positional-args

This PR adds positional arguments to the argument parser.

Scope of work defined in Cray/chapel-private#2302, this work satisfies
the main goals of that issue which are to:

  1. Allow the developer to add positional arguments to their CLI
  2. Allow options, subcommands, flags, and positional arguments to be
    entered together
  3. Identify positional arguments at the beginning, end, or intermixed within a
    command string

Relates to broader implementation task in Cray/chapel-private#2192

Tests added for flags and mixing positional arguments, subcommands, options,
and flags.

Example updated to include flags.

TESTING:

After running make cleanall from $CHPL_HOME:

  • [x] Can make
  • [x] Can make docs
  • [x] Can make mason
  • [x] Can make check
  • [x] Passing tests from util/start_test test/mason/mason-argparse

Reviewed by @mppf

Signed-off-by: Ahmad Rezaii ahmad.rezaii@hpe.com

Modified Files:
M test/mason/mason-argparse/MasonArgParseExample.chpl

M test/mason/mason-argparse/MasonArgParseExample.good
M test/mason/mason-argparse/MasonArgParseExample.lastexecopts
M test/mason/mason-argparse/MasonArgParseTests.chpl
M test/mason/mason-argparse/MasonArgParseTests.good
M tools/mason/MasonArgParse.chpl

Compare: https://github.com/chapel-lang/chapel/compare/4e5aa0cb39d0...6288a4fe5409