ototo / jic

JIRA Command Line Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support pipes for text input

mturquette opened this issue · comments

I typically use comments to record progress on an issue. Often that progress is best expressed output from tools such as git. As an example, I might copy a git log from the cmdline and paste it into a comment text area. A nicer way to do this would be to pipe the text in. E.g:

git log --oneline v3.15-rc6..clk-fixes | jic comment CARD-123

Which in my case would create a comment with the following text:

5178438 Merge tag 'clk-tegra-fixes-3.15' of git://nv-tegra.nvidia.com/user/pdeschrijver/linux into clk-fixes
72b1c2c clk: st: Fix memory leak
fe52e75 clk: divider: Fix table round up function
4ccc402 clk: tegra: Fix enabling of PLLE
c61e4e7 clk: tegra: Introduce divider mask and shift helpers
d0f02ce clk: tegra: Fix PLLE programming

A related feature would be to have "jic comment" just take a string, e.g:

jic comment add CARD-123 "Hello, world"

Any single-field operation should support piping in the data or taking a
double-quoted strong on the cmdline. Of course that doesn't work as well
for multiple field input.
On Jun 18, 2014 8:33 AM, "khilman" notifications@github.com wrote:

A related feature would be to have "jic comment" just take a string, e.g:

jic comment add CARD-123 "Hello, world"


Reply to this email directly or view it on GitHub
#9 (comment).

Not yet fully implemented. Currently it is possible to add comment by piping content in, but if that content contains more then one line of text, it should be wrapped into '{{{' + '}}}' markers:

# porcelain mode version
$ (echo '{{{' ; git log --oneline v3.15-rc6..clk-fixes ; echo '}}}') | jadd CARD-123

# plumbing mode version
$ (echo '{{{' ; git log --oneline v3.15-rc6..clk-fixes ; echo '}}}') | jic comments add CARD-123

Does this mean that I can do something like:

jic comments add CARD-123 -

And then type stuff in from STDIN until I pass in EOF?

On Fri, Nov 7, 2014 at 6:35 AM, Serge Broslavsky notifications@github.com
wrote:

Not yet fully implemented. Currently it is possible to add comment by
piping content in, but if that content contains more then one line of text,
it should be wrapped into '{{{' + '}}}' markers:
porcelain mode version

$ (echo '{{{' ; git log --oneline v3.15-rc6..clk-fixes ; echo '}}}') |
jadd CARD-123
plumbing mode version

$ (echo '{{{' ; git log --oneline v3.15-rc6..clk-fixes ; echo '}}}') | jic
comments add CARD-123


Reply to this email directly or view it on GitHub
#9 (comment).

Not quite - there is no need to specify '-' as argument. If -e (use editor) switch is missing, jic is expecting input from stdin.

If you want to pipe in some multiline text, you need to wrap it into markers as I've mentioned in my previous comment - jic is expecting a single jicML value. Please see man jicml for details on what jicML value might be.

You could do the following though:

$ jic comments add CARD-123 <<EOF
{{{
One line.
Another line.
}}}
EOF

PS. I'm planning adding a switch that would ask jic to treat all lines in stdin as a single value with no need to use jicML ws folding or markers - to allow easy piping from e.g. git's output.