-
Notifications
You must be signed in to change notification settings - Fork 0
/
args.go
28 lines (23 loc) · 1021 Bytes
/
args.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
// CLI argument definitions
type (
SMSActionArgs struct {
Send *SMSSendArgs `validate:"-" arg:"subcommand:send" help:"Send SMS"`
Read *SMSReadArgs `validate:"-" arg:"subcommand:read" help:"Read SMS"`
}
SMSSendArgs struct {
PhoneNumber string `validate:"e164" arg:"-p,--phone,required" help:"Receiver's phone number"`
Message string `validate:"printascii" arg:"-m,--msg,required" help:"Message to be sent"`
}
SMSReadArgs struct {
}
ConnectionArgs struct {
Action string `arg:"positional,required" help:"up/down/status" validate:"oneof=up down status"`
}
BaseArgs struct {
Connection *ConnectionArgs `validate:"-" arg:"subcommand:conn" help:"Manage cell connection"`
SMS *SMSActionArgs `validate:"-" arg:"subcommand:sms" help:"Manage SMS"`
Host string `validate:"omitempty,ipv4|hostname" arg:"--host" help:"Override hostname in config file"`
DisableColor bool `arg:"--plain" help:"Disable color for better software interaction"`
}
)