Skip to content

cmta and cmtc commands should report an error when an undefined option is passed in #200

@eloots

Description

@eloots

It appears that when an undefined option is passed to cmtc or cmta, the command is silently ignored and no error is reported.

For example, let's use the cmtc set-current-course command.

On the happy path:

$ cmtc set-current-course -h
Usage: cmtc set-current-course [options]
Sets the current course to point to a directory

Help options:
  --usage            Print usage and exit
  -h, -help, --help  Print help message and exit

Other options:
  -s, --directory file

$ cmtc set-current-course --directory ~/tmp/stu/lunatech-scala-2-to-scala3-course
Current course set to '/Users/ericloots/tmp/stu/lunatech-scala-2-to-scala3-course'

$ cmtc set-current-course -s ~/tmp/stu/lunatech-scala-2-to-scala3-course
Current course set to '/Users/ericloots/tmp/stu/lunatech-scala-2-to-scala3-course'

$

Now, when mistyping the option (long or short):

$ cmtc set-current-course --directorys ~/tmp/stu/lunatech-scala-2-to-scala3-course


$ cmtc set-current-course -d ~/tmp/stu/lunatech-scala-2-to-scala3-course


$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions