# CLI: revert \-l behavior · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e565ff305ae208b15058a462d348fde515b3e950)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e565ff305ae208b15058a462d348fde515b3e950

Requested commit: e565ff305ae208b15058a462d348fde515b3e950

Commit: e565ff305ae208b15058a462d348fde515b3e950

Tree: 31fd4344027677cf9c854d610c1b6ee9eeae4c44

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
CLI: revert -l behavior

chicken out and make -l match the status quo behavior, where it looks
for dynamic libraries and then falls back to static libraries.

library resolution is still done in the CLI now though, and these
options are added:

-search_static_first           Search for static libs in all library search
                               paths, then dynamic libs.
-search_dylibs_only            Only search for dynamic libs.
-search_static_only            Only search for static libs.

this matches the already existing options below:

-search_paths_first            For each library search path, check for dynamic
                               lib then static lib before proceeding to next path.
-search_dylibs_first           Search for dynamic libs in all library search

So, it is still possible to get the strict behavior by passing
`-search_dylibs_only` or `-search_static_only`.

This commit also makes -dynamic and -static affect the preferred link
mode and search strategy.

```

## Parents

- [9e50f960875601dbaaf7245cedb7d9e429678aeb](https://git.cafe/gitcafe/zig/commit/9e50f960875601dbaaf7245cedb7d9e429678aeb?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e565ff305ae208b15058a462d348fde515b3e950?format=markdown)
