It is a simple approach but it works: Read the name of the binary from the Cargo.toml file and check whether the name appears in the path. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>