# Interpolate pkg string a la pkg"status $x"

**URL:** <https://discourse.julialang.org/t/interpolate-pkg-string-a-la-pkg-status-x/20971>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [February 19, 2019, 10:06am UTC](https://discourse.julialang.org/t/interpolate-pkg-string-a-la-pkg-status-x/20971 "2019-02-19T10:06:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 19, 2019, 10:06am UTC](https://discourse.julialang.org/t/interpolate-pkg-string-a-la-pkg-status-x/20971/1 "2019-02-19T10:06:20Z")

</div>

```julia
x = "BenchmarkTools" # just an example
pkg"status $x" # what I want but doesn't work

```

Looking at the [definition of `@pkg_str`](https://github.com/JuliaLang/Pkg.jl/blob/master/src/REPLMode.jl#L718) I figured I can do

```julia
x = "BenchmarkTools"
s = "status $x"
Pkg.REPLMode.do_cmd(Pkg.REPLMode.minirepl[], s; do_rethrow=true)

```

which works but is arguably ugly.

Is there a nice way that I’m missing?

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [February 19, 2019, 10:11am UTC](https://discourse.julialang.org/t/interpolate-pkg-string-a-la-pkg-status-x/20971/2 "2019-02-19T10:11:19Z")

</div>

Ok, there is also `Pkg.status("BenchmarkTools")`. But nonetheless, shouldn’t it be possible to interpolate values into a pkg string?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 19, 2019, 10:13am UTC](https://discourse.julialang.org/t/interpolate-pkg-string-a-la-pkg-status-x/20971/3 "2019-02-19T10:13:19Z")

</div>

You can do

```julia
> x = "BenchmarkTools";

> Pkg.REPLMode.pkgstr("status $x")

```

This has nothing to do with “pkg string” but with string macros in general.
