<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 16, 2017 at 10:52 AM, Kai Hendry <span dir="ltr"><<a href="mailto:hendry@webconverger.com" target="_blank">hendry@webconverger.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
I maintain a service file with a lot of switches in the ExecStart<br>
<a href="https://github.com/kaihendry/pingprom/blob/master/prometheus%40.service#L8" rel="noreferrer" target="_blank">https://github.com/kaihendry/<wbr>pingprom/blob/master/<wbr>prometheus%40.service#L8</a><br>
<br>
I want to almost document each switch ... e.g.<br>
-storage.local.retention=8544h # keep data for a year<br>
<br>
I know inline comments do *not* work in bash IIUC:<br>
<a href="https://gist.github.com/kaihendry/ff751622c6454176837b1c340b5cfccb" rel="noreferrer" target="_blank">https://gist.github.com/<wbr>kaihendry/<wbr>ff751622c6454176837b1c340b5cfc<wbr>cb</a><br>
<br>
And similarly when I try break up lines on something like<br>
<a href="https://s.natalian.org/2017-08-16/test.service" rel="noreferrer" target="_blank">https://s.natalian.org/2017-<wbr>08-16/test.service</a><br>
<br>
[Service]<br>
ExecStart=/usr/bin/curl -X POST<br>
-d "fizz=systemd" # some docs<br>
-d "some=else" # more docs<br>
<a href="https://requestb.in/19v8a0m1" rel="noreferrer" target="_blank">https://requestb.in/19v8a0m1</a><br>
<br>
<br>
It also doesn't work. Am I missing a tool or way to better<br>
format/document process arguments like I want?<br></blockquote><div><br></div><div>Just put everything in a shell script. (That way you can test it directly without systemd, too.)</div><div><br></div><div>With bash, you can use inline comments in arrays: </div><div><br></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><div><font face="monospace, monospace">#!/usr/bin/env bash</font></div></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace">args=(</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace"> -X POST # foo</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace"> -d "fizz=systemd" # some docs</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace"> -d "some=else" # more docs</font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace"> <a href="https://requestb.in/foo">https://requestb.in/foo</a></font></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace">)</font></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace">exec curl "${args[@]}"</font></div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><font face="monospace, monospace"><br></font></div></div></div><div class="gmail_extra">-- <br><div class="gmail_signature"><div dir="ltr">Mantas Mikulėnas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>></div><div dir="ltr"><br></div></div>
</div></div>