he gave a short whistle as he shrugged it on , and the dog , lying near the foot of the bed and watching him , rose up on legs like stilts , stretched and yawned , and came up to him , wagging its tail .