forked from toolshed/abra
		
	fix: parse args correctly for validation
This commit is contained in:
		@ -54,12 +54,13 @@ All communication between Abra and the server will use this SSH connection.
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	ArgsUsage: "<domain> [<user>] [<port>]",
 | 
						ArgsUsage: "<domain> [<user>] [<port>]",
 | 
				
			||||||
	Action: func(c *cli.Context) error {
 | 
						Action: func(c *cli.Context) error {
 | 
				
			||||||
		if c.Args().Len() == 1 && !local {
 | 
					
 | 
				
			||||||
 | 
							if c.Args().Len() == 2 && !local {
 | 
				
			||||||
			err := errors.New("missing arguments <domain> or '--local'")
 | 
								err := errors.New("missing arguments <domain> or '--local'")
 | 
				
			||||||
			internal.ShowSubcommandHelpAndError(c, err)
 | 
								internal.ShowSubcommandHelpAndError(c, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if c.Args().Get(1) != "" && local {
 | 
							if c.Args().Get(2) != "" && local {
 | 
				
			||||||
			err := errors.New("cannot use '<domain>' and '--local' together")
 | 
								err := errors.New("cannot use '<domain>' and '--local' together")
 | 
				
			||||||
			internal.ShowSubcommandHelpAndError(c, err)
 | 
								internal.ShowSubcommandHelpAndError(c, err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user