I had a similar application where i was using a switching regulator to charge a 3F or so supercap.
The way i did it there was using an analog solution that amplified the signal from a shunt resistor and used that to inject current into the FB pin when above a threshold. Since the shunt was on the output this resulted in the switching supply acting like a constant current source at a few amps to charge up the cap in a nice ramp. Once the set voltage starts to get reached then the regular resistor divider on the FB pin takes over, so the current in the output drops and the extra current limiting circuit stops messing with the FB pin.
The circuit was as simple as just a cheep high side current sense amplifier chip, creating a voltage proportional to current, then just put a diode (actually a BJT wired as a diode for more stable forward threshold) from the sense amplifier to the FB pin. So whenever the voltage out of the sense amplifier is above Vfb+0.6V it would pull up on the FB pin and convince the regulator to reduce output.
I had the output current limited because i wanted to charge my capacitor as fast as the switcher could (the limiting factor being the internal switch current), but i am guessing you want to limit the current going into the input of the switching regulator. In that case you can just move the shunt over to the input and it should work fine. You also want to leave some space for loop compensation capacitors in a few spots, since doing funky things to the FB pin can sometimes cause things to become unstable and oscillate. Those caps let you wrangle the regulation loop back into stability by slowing things down.