take `Include` directive into consideration
Closed this issue · 8 comments
All my aliases are defined in different config files, using ssh_config Include
directive.
serge minos ~
➡ cat .ssh/config
Include config.d/*
serge minos ~
➡ manssh list
✔ Listing 0 records.
Thank you for your feedback, I'll fix this.
This should also handle relative directories, and the tilde for homedir, as my Include
directives are all in the form Include ~/.ssh/config.d/<file>
, though I can adjust mine to be relative to ~/.ssh
no problem.
And it would be super great if it gave the reference of which file it found the directive in, as well as giving the option to write to a particular file (perhaps defaulting to ~/.ssh/config.d/)
~ % cat .ssh/config
Include ~/.ssh/config.d/*
Host *
usekeychain yes
~ %
Hi, @srgvg @StephenBrown2
Any other suggestions?
Beautiful!
I'm confused. I doublechecked I have the latest compiled version, but still get this:
➡ ./manssh l -p
Incorrect Usage: flag provided but not defined: -p
Also this
MANSSH_SHOW_PATH=1 ./manssh list
doesn't show any paths?
I'm als not sure what "Global" config means. AFAIU ssh gives precedence to the first matching records, hence the first Host *
enforces configs for all hosts, whilst the last one will define defaults.
Either way, having both (in the first and last included files, which have a name with a number to enforce order), I don't get a "global" setting.
Do yo mean global as in the default -f
config file? Then there's a big difference if those sections are noted before or after the include statements, and if they target Host *
or more specific host patterns.
What are your thoughts on this?
Many thanks for you work, either way!
This my fault, I didn't make it clear, It has not been released, I post the picture just want you to look the result, and if you have some good suggestions, I will continue to update.
The question of "Global" config, I think it's a bug and I'll fix it. Thank you for pointing this out.
This project is actually a simple glue project, the most complex and core parsing ssh config
file logic implements by ssh_config, I didn't do much.
OK, np. Let me know when you have something I can test. Happy to help. Thank you.
Hi, sorry for my lateness, I just released v0.5.0
, you can check it out.
I rethink the problem of Global
config and decided to show the implicit config for each alias instead of show unclear Global
config, manssh list
displays the config that is actually in effect.
In this case, It merges * config in two files, the results vary with the location of the Include
. For the www
alias, It shows its own(cyan) and implicit configuration(white) from *
, the key is that the display config is exactly the config that will take effect when entering ssh www
.
I will update README file and test cases, please let me know if you find anything unexpected, I'm absolutely happy to keep working on it. :)