File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,14 @@ func read_in_stdin(debug bool) string {
34
34
}
35
35
36
36
// if info.Mode()&os.ModeCharDevice != 0 || info.Size() <= 0 {
37
- if info .Mode ()& os .ModeCharDevice == os .ModeCharDevice || info .Size () <= 0 {
38
- fmt .Println ("The command is intended to work with pipes." )
39
- fmt .Println ("Usage: echo mytext | stdin2rabbitmq" )
40
- os .Exit (1 )
37
+ // ModeCharDevice works on a console where you have a terminal
38
+ if (info .Mode ()& os .ModeCharDevice == os .ModeCharDevice || info .Size () <= 0 ) {
39
+ // ModeNamedPipe is when you are ssh'd into something
40
+ if (info .Mode ()& os .ModeNamedPipe == os .ModeNamedPipe || info .Size () <= 0 ) {
41
+ fmt .Println ("The command is intended to work with pipes." )
42
+ fmt .Println ("Usage: echo mytext | stdin2rabbitmq" )
43
+ os .Exit (1 )
44
+ }
41
45
}
42
46
43
47
reader := bufio .NewReader (os .Stdin )
You can’t perform that action at this time.
0 commit comments