Skip to content

Commit

Permalink
Support '-' argument as stdin input in log_mixer
Browse files Browse the repository at this point in the history
  • Loading branch information
fenrir-naru committed Oct 3, 2023
1 parent ee2d58f commit 3b025c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tool/log_mixer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ def read_chunk
:imu => ARGV.shift,
}
$log_mix.call({:readers => [
IMU_CSV::new(open(src[:imu], 'r')),
GPS_UBX::new(open(src[:gps], 'rb')),
IMU_CSV::new((src[:imu] == '-') ? $stdin : open(src[:imu], 'r')),
GPS_UBX::new((src[:gps] == '-') \
? proc{STDIN.binmode; $stdin}.call \
: open(src[:gps], 'rb')),
]})

end

0 comments on commit 3b025c0

Please sign in to comment.