@@ -53,19 +53,21 @@ fn main() -> Result<()> {
53
53
let mut opts = Opts :: parse ( ) ;
54
54
let config = Config :: load ( ) ?;
55
55
56
- // If neither the IMAGE nor SERIAL arguments have been provided, print the help
57
- // message and exit.
58
- if opts. image . is_none ( ) && opts. connect_opts . serial . is_none ( ) {
59
- Opts :: command ( ) . print_help ( ) . ok ( ) ;
60
- return Ok ( ( ) ) ;
61
- }
56
+ if !matches ! ( opts. subcommand, Some ( SubCommand :: BoardInfo ( ..) ) ) {
57
+ // If neither the IMAGE nor SERIAL arguments have been provided, print the
58
+ // help message and exit.
59
+ if opts. image . is_none ( ) && opts. connect_opts . serial . is_none ( ) {
60
+ Opts :: command ( ) . print_help ( ) . ok ( ) ;
61
+ return Ok ( ( ) ) ;
62
+ }
62
63
63
- // If only a single argument is passed, it *should* always be the ELF file.
64
- // In the case that the serial port was not provided as a command-line argument,
65
- // we will either load the value specified in the configuration file or do port
66
- // auto-detection instead.
67
- if opts. image . is_none ( ) && opts. connect_opts . serial . is_some ( ) {
68
- swap ( & mut opts. image , & mut opts. connect_opts . serial ) ;
64
+ // If only a single argument is passed, it *should* always be the ELF file. In
65
+ // the case that the serial port was not provided as a command-line argument, we
66
+ // will either load the value specified in the configuration file or do port
67
+ // auto-detection instead.
68
+ if opts. image . is_none ( ) && opts. connect_opts . serial . is_some ( ) {
69
+ swap ( & mut opts. image , & mut opts. connect_opts . serial ) ;
70
+ }
69
71
}
70
72
71
73
if let Some ( subcommand) = opts. subcommand {
0 commit comments