diff --git a/clusterssh/ChangeLog b/clusterssh/ChangeLog index d4222d5..ad3d4d0 100644 --- a/clusterssh/ChangeLog +++ b/clusterssh/ChangeLog @@ -23,6 +23,7 @@ starting a new column - see .csshrc doc for "max_host_menu_items". This is until Tk allows for scrollable menus * Amend default key_addhost from 'Control-plus' to 'Control-Shift-plus' +* Add in a 'default' cluster tag, used when no tags provided on command line 2009-03-26 Duncan Ferguson - v3.25-1 diff --git a/clusterssh/src/cssh.pl b/clusterssh/src/cssh.pl index 647cffe..e53b440 100755 --- a/clusterssh/src/cssh.pl +++ b/clusterssh/src/cssh.pl @@ -952,7 +952,8 @@ sub split_hostname { # could have an invalid IPv6 address here, but the connect # method will warn if it cannot connect anyhow # However, this also catchs IPv4 addresses, possibly with ports - ( $server, $port ) = $connect_string =~ m/^([\w.-]+)(?::(\d+))?$/xsm; + ( $server, $port ) + = $connect_string =~ m/^([\w.-]+)(?::(\d+))?$/xsm; } } } @@ -2034,7 +2035,14 @@ load_keyboard_map(); get_clusters(); -@servers = resolve_names(@ARGV); +if (@ARGV) { + @servers = resolve_names(@ARGV); +} +else { + if ( $clusters{default} ) { + @servers = resolve_names( split( /\s+/, $clusters{default} ) ); + } +} create_windows(); create_menubar(); @@ -2393,6 +2401,10 @@ Clusters may also be specified either directly (see C configuration options) or indirectly (see C configuration option) in the users F<$HOME/.csshrc> file. +NOTE: there is a special cluster tag called C - any tags or hosts +included within this tag will be automatically opened if no other tags +are specified on the command line. + =item F & F<$HOME/.csshrc> This file contains configuration overrides - the defaults are as marked.