Skip to content

Behavior of short with value including equals #126

Description

@bcoe

I found the behavior of -a=5 surprising (I was assuming it would simply be the value "5").

test('when combine string short with value including equals then parsed with equals in value', (t) => {
  const args = ['-a=5'];
  const options = { alpha: { short: 'a', type: 'string' } };
  const expected = { values: { __proto__: null, alpha: '=5' }, positionals: [] };

  const result = parseArgs({ args, options });

  t.deepEqual(result, expected);
  t.end();
});

Can someone refresh me on how we landed on this behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions