mavlink / rust-mavlink

MAVLink library for Rust.
https://mavlink.github.io/rust-mavlink/mavlink/
Apache License 2.0
158 stars 79 forks source link

Move mavlink-dump from src/bin to examples/mavlink-dump #215

Closed antonio-sc66 closed 10 months ago

antonio-sc66 commented 10 months ago

Refactor mavlink-dump. Change from [[bin]] to [[example]].

Splitting the example has the following benefits:

Disadvantage:

When running cargo run --example mavlink-dump compilation time and execution stays the same or better (easier to retain compilation incremental files)

Installation output

/rust-mavlink$ cargo install --path examples/mavlink-dump
  Installing mavlink-dump v0.1.0 (/foo/rust-mavlink/examples/mavlink-dump)
    Updating crates.io index
    Finished release [optimized] target(s) in 1.91s
   Replacing /foo/.cargo/bin/mavlink-dump
    Replaced package `mavlink-dump v0.1.0 (/foo/rust-mavlink/examples/mavlink-dump)` with `mavlink-dump v0.1.0 (/foo/examples/mavlink-dump)` (executable `mavlink-dump`)

Empty args execution

rust-mavlink$ mavlink-dump
Usage: mavlink-dump (tcpout|tcpin|udpout|udpin|udpbcast|serial|file):(ip|dev|path):(port|baud)
antonio-sc66 commented 10 months ago

The CI for the mavlink-dump is failing as the call cargo build --verbose --bin mavlink-dump --features ardupilotmega has to be replaced by cargo build --example mavlink-dump