# command.Command.target

- **Module:** command.Command
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/command.rs#L165
- **Page:** https://libtmux.org/reference/rs/command-command-target/

```
command.Command.target(self) -> Option<&OsStr>
```

Return the value of the command's `-t` flag, when it has one.

Used to name the object in a failure. tmux does not always repeat the
target it could not resolve, so this recovers it from the request.

The first `-t` wins, which is what tmux does: it parses flags before
positionals. A positional that happens to read `-t` can only be
reached after tmux has already taken the flag, so the worst case is a
mislabelled error rather than a wrong one.
