1/*
2Copyright 2018-2019 The Doctl Authors All rights reserved.
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6    http://www.apache.org/licenses/LICENSE-2.0
7Unless required by applicable law or agreed to in writing, software
8distributed under the License is distributed on an "AS IS" BASIS,
9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10See the License for the specific language governing permissions and
11limitations under the License.
12*/
13
14package doctl
15
16import "fmt"
17
18// MissingArgsErr is returned when there are too few arguments for a command.
19type MissingArgsErr struct {
20	Command string
21}
22
23var _ error = &MissingArgsErr{}
24
25// NewMissingArgsErr creates a MissingArgsErr instance.
26func NewMissingArgsErr(cmd string) *MissingArgsErr {
27	return &MissingArgsErr{Command: cmd}
28}
29
30func (e *MissingArgsErr) Error() string {
31	return fmt.Sprintf("(%s) command is missing required arguments", e.Command)
32}
33
34// TooManyArgsErr is returned when there are too many arguments for a command.
35type TooManyArgsErr struct {
36	Command string
37}
38
39var _ error = &TooManyArgsErr{}
40
41// NewTooManyArgsErr creates a TooManyArgsErr instance.
42func NewTooManyArgsErr(cmd string) *TooManyArgsErr {
43	return &TooManyArgsErr{Command: cmd}
44}
45
46func (e *TooManyArgsErr) Error() string {
47	return fmt.Sprintf("(%s) command contains unsupported arguments", e.Command)
48}
49