From: Matej S. <mat...@co...> - 2013-12-13 23:07:37
|
On Fri, Dec 13, 2013 at 11:50 PM, Matej Sekoranja < mat...@co...> wrote: > > > > On Fri, Dec 13, 2013 at 10:42 PM, White, Greg <gr...@sl...>wrote: > >> Hi Andrew, >> >> I wouldn't mind at all if, when given no arguments, eget/pvget/pvput sit >> waiting for input. On unix at least that strikes me as entirely >> reasonable. >> That's what many unix tools do. >> > > This is reasonable for tools that require some input from a pipe... > For me eget waiting for input is unreasonable, since it's a tool that > primary does not need any piped input. > And '-' is a standard way to tell input is stdin. > Another point. Imagine a typical users. You know them better... and they are not unix experts. eget waiting for input would confuse them. On the other hand, an unix expert will try '-' in a heartbeat. > I'll try to find out if I can get a non-blocking indication there is no > data in stdin (I've tried peek() and searched the www and found nothing but > answers this is not possible). I need to check "less" source. > I've found it. The trick is calling *isatty(0)* It returns 1 if input is tty, otherwise 0 (in case of a pipe). Should work on Win too. Hmm... Matej >> I also wouldn't mind if they do issue an error if no input is on the input >> stream. That's also fine, as long as HERE files work. >> >> About whether the detection method is "portable" to windows - that seems >> like a false requirement. eget on unix should behave as expected on unix. >> eget on windows should behave as expected on windows. >> >> Cheers >> Greg >> >> >> >> On Dec 13, 2013, at 1:07 PM, Andrew Johnson <an...@ap...> wrote: >> >> Greg, >> >> You want to be able to pipe a list of PV names into eget or pvget >> without giving any flags. If Matej does that, when someone runs >> eget/pvget with no options at all and without a pipe, won't they have to >> sit there reading stdin waiting for you to type a list of PV names? >> Currently they output a friendly error message: >> >> tux% bin/linux-x86_64/eget >> No PV name(s) specified. ('eget -h' for help.) >> tux% bin/linux-x86_64/pvget >> No pv name(s) specified. ('pvget -h' for help.) >> >> Apparently there is a way to avoid that since both less and more are >> able to detect that stdin is not a pipe, but I'm not sure how portable >> their detection method is (however they do it, does Windows support the >> same method?): >> >> tux% less >> Missing filename ("less --help" for help) >> tux% more >> usage: more [-dflpcsu] [+linenum | +/pattern] name1 name2 ... >> >> - Andrew >> >> On 12/13/2013 12:41 PM, White, Greg wrote: >> >> Matej, I like the -p (as long as it's symmetrical with pvget/put) but the >> - is a trick >> very few people will know. Why not simply "| eget" or "| pvget" like any >> other unix tool? >> >> Thanks >> Greg >> >> >> On Dec 13, 2013, at 3:43 AM, Matej Sekoranja <mat...@co... >> <mailto:mat...@co... <mat...@co...>>> >> wrote: >> >> >> 4. Want e/pvget and put to take a stream, so when using Channel Finder or >> some other >> names service to get the values of a bunch of things, I can do simply pipe >> to eget. Eg getting polynomials for bunch of quads now makes me do this: >> >> eget -ts names -a pattern=QUAD:LTU1:8%:POLYCOEF | xargs -tI{} eget >> ca:///{} >> >> but I should be able to just do this: >> >> eget -s names -a pattern=QUAD:LTU1:8%:POLYCOEF | eget >> >> An AI for me. >> How would you solve missing "ca:///" prefix? >> >> Done. Now you can use (mind the dash at the end; it is really needed, and >> a standard way of specifying stdin as input): >> >> eget -s names -a pattern=QUAD:LTU1:8%:POLYCOEF | eget - >> >> Now, if you want to use 'ca' as default provider: >> >> eget -s names -a pattern=QUAD:LTU1:8%:POLYCOEF | eget -p ca - >> >> Matej >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >> >> >> -- >> Advertising may be described as the science of arresting the human >> intelligence long enough to get money from it. -- Stephen Leacock >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >> >> >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >> > > |