Return usage command for pmm-admin inventory add service

Description

During testing of PMM-5776 was found some difference in validation of pmm-admin inventory add service command. For example, if I'm trying to add external service with:

pmm-admin inventory add service external

the next message is returned:

pmm-admin: error: required flag --node-id not provided, try --help

But if I run pmm-admin inventory add service mysql|mongodb|... I see the error message:

[ec2-user@ip-10-178-2-127 ~]$ pmm-admin inventory add service mysql invalid field ServiceName: value '' must not be an empty string

I think we should implement the same behaviour for all commands. If user run command without any arguments pmm-admin should return help message.

How to test

None

How to document

None

relates to

Smart Checklist

Activity

Alexey Palazhchenko September 1, 2020 at 6:44 AM

We now consider positional arguments to be a UX mistake, and want to encourage people to use flags

New commands will not have multiple positional arguments.

Details

Assignee

Reporter

Priority

Components

Labels

Needs QA

Yes

Needs Doc

Yes

Affects versions

Smart Checklist

Created April 29, 2020 at 8:41 AM
Updated March 6, 2024 at 4:32 AM

Flag notifications