-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give script templates access to their own name and other metadata #137
Comments
I think adding a
That will correctly double-quote the input string, for example:
|
A trivial change in kingpeon will allow for you to access the calling command properties, like this:
So I think I will get that change in. |
coryb
added a commit
that referenced
this issue
Jan 7, 2018
This looks great, another job well done. |
Also I didn't know about the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a duplicate of coryb/kingpeon#2, but it's replicated here in the event it can be solved faster/better within
go-jira
.You can access
options
andargs
via function (kingpeon.go#L68) but there is no way for a script template to discover the command that triggered it, or other useful information.I'm trying to make a common entry point like so:
The script is the same for every custom command except for the word
sync
(or whatever command is in play) because I don't see a way to get that info, eg.{{.name}}
.Could we assign
.
to the config so things like.name
or.help
work? Or something else?If there was a
toJson
that returned compact JSON, it would help avoid the quoted heredoc nonsense above, which I'm using as a safe way to pass the prettified, unquoted JSON. Lastly, ashellquote
function would be massively appreciated! Combined with compact JSON, one could then safely:(It might also be useful to expand
options
to--opt=abc -ddd ...
or whatever, but I don't need that myself, and prefer to work with the JSON blob version ofoptions
andargs
)Shell quoting is pretty straightforward; surround text with
'
and replace single-quotes with'\''
.The text was updated successfully, but these errors were encountered: