More progress on file completion. Fixed long-standing bug affecting shortoptions only in get_cfg_idx.