minder icon indicating copy to clipboard operation
minder copied to clipboard

Accept names in CLI arguments as positional arguments

Open dmjb opened this issue 1 year ago • 1 comments

Please describe the enhancement

In a number of places in the CLI, we allow objects in the system to be referred to by either ID or name. The general convention is:

minder foo get --id <uuid>
minder foo get --name <name>

Instead, let's use a scheme like this:

minder foo get <name>
minder foo get --id <uuid>

My thinking:

  1. Name is likely to be the most common way these commands will be used
  2. Using flags for mandatory arguments feels kinda janky for a *nix CLI tool

Solution Proposal

  1. Modify CLI code to accept positional arguments
  2. Keep --id as-is
  3. Keep --name for backwards compatibility, but mark as deprecated

Describe alternatives you've considered

No response

Additional context

No response

Acceptance Criteria

No response

dmjb avatar Apr 05 '24 12:04 dmjb

We should fix this consistently everywhere.

The general rule I've seen elsewhere is to use positional arguments for required fields, and flags for optional ones.

evankanderson avatar Jul 30 '24 13:07 evankanderson