pixelb / crudini

A utility for manipulating ini files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add support for ssh config files (~/.ssh/config)

ssbarnea opened this issue · comments

It would be really nice if crudini would be able to configure ssh config files too.

If anyone is aware about another tool that can do this please post a message. Using sed is not really the best (and safe) way to do it.

This is a good idea as the formats are close.
In general it would be good to support filters to adjust to/from ini format,
so you could crudini --filter=ssh to support this format for example.

Something like this processing would work internally, to ini format:
sed 's/^Host \(.*\)/[\1]/; s/^ *//; s/ / = /'
and from ini format:
sed '/^\[/,$ {s/^\[\(.*\)\]/Host \1/;t;s/^/ /}'