Add in more documentation sections

This commit is contained in:
Duncan Ferguson 2014-06-08 09:51:28 +01:00
parent a802b09964
commit 13442fb156
2 changed files with 81 additions and 15 deletions

View file

@ -283,14 +283,9 @@ sub _generate_pod {
print "S<< $Script $self->{usage} >>",$/,$/;
print '=head1 ',$self->loc('DESCRIPTION'),$/,$/;
print $self->loc("_DESCRIPTION"),$/,$/;
print '=head2 '.$self->loc('Further Notes'),$/,$/;
print $self->loc("_FURTHER_NOTES"),$/,$/;
print '=over',$/,$/;
for (1 .. 6) {
print '=item *',$/,$/;
print $self->loc("_FURTHER_NOTES_".$_),$/,$/;
}
print '=back',$/,$/;
$self->_pod_output_list_section(2,'Further Notes');
print '=head1 '.$self->loc('OPTIONS'),$/,$/;
print $self->loc("_OPTIONS"),$/,$/;
@ -334,7 +329,39 @@ sub _generate_pod {
}
print '=back',$/,$/;
# now list out alphabetically all defined options
$self->_pod_output_list_section(1,'ARGUMENTS');
$self->_pod_output_list_section(1,'KEY SHORTCUTS');
$self->_pod_output_list_section(1,'EXAMPLES');
return $self;
}
sub _pod_output_list_section {
my ($self, $level, $section) = @_;
print '=head'.$level.' ',$self->loc($section),$/,$/;
$section=uc($section);
$section=~s/ /_/g;
print $self->loc('_'.$section),$/,$/;
print '=over',$/,$/;
for (1 .. 10) {
# there might not be 10 sections so catch errors
my ($name, $desc);
eval {
$name = $self->loc('_'.$section.'_NAME_'.$_);
};
eval {
$desc=$self->loc('_'.$section.'_DESC_'.$_);
};
# and if there is an error we have gone past the last item
#last if($@);
if($desc) {
print '=item ', $name || '*',$/,$/;
print $desc,$/,$/;
}
}
print '=back',$/,$/;
return $self;
}

View file

@ -12,17 +12,17 @@ Extra caution should be taken when editing system files such as /etc/inet/hosts
'_FURTHER_NOTES' => q{Please also see "KNOWN BUGS".},
'_FURTHER_NOTES_1' => q{The dotted line on any sub-menu is a tear-off, i.e. click on it and the sub-menu is turned into its own window.},
'_FURTHER_NOTES_DESC_1' => q{The dotted line on any sub-menu is a tear-off, i.e. click on it and the sub-menu is turned into its own window.},
'_FURTHER_NOTES_2' => q{Unchecking a hostname on the Hosts sub-menu will unplug the host from the cluster control window, so any text typed into the console is not sent to that host. Re-selecting it will plug it back in.},
'_FURTHER_NOTES_DESC_2' => q{Unchecking a hostname on the Hosts sub-menu will unplug the host from the cluster control window, so any text typed into the console is not sent to that host. Re-selecting it will plug it back in.},
'_FURTHER_NOTES_3' => q{If your window manager menu bars are obscured by terminal windows see the C<screen_reserve_XXXXX> options in the F<$HOME/.clusterssh/config> file (see L</"FILES">).},
'_FURTHER_NOTES_DESC_3' => q{If your window manager menu bars are obscured by terminal windows see the C<screen_reserve_XXXXX> options in the F<$HOME/.clusterssh/config> file (see L</"FILES">).},
'_FURTHER_NOTES_4' => q{If the terminals overlap too much see the C<terminal_reserve_XXXXX> options in the F<$HOME/.clusterssh/config> file (see L</"FILES">).},
'_FURTHER_NOTES_DESC_4' => q{If the terminals overlap too much see the C<terminal_reserve_XXXXX> options in the F<$HOME/.clusterssh/config> file (see L</"FILES">).},
'_FURTHER_NOTES_5' => q{When using cssh on a large number of systems to connect back to a single system (e.g. you issue a command to the cluster to scp a file from a given location) and when these connections require authentication (i.e. you are going to authenticate with a password), the sshd daemon at that location may refuse connects after the number specified by MaxStartups in sshd_config is exceeded. (If this value is not set, it defaults to 10.) This is expected behavior; sshd uses this mechanism to prevent DoS attacks from unauthenticated sources. Please tune sshd_config and reload the SSH daemon, or consider using the ~/.ssh/authorized_keys mechanism for authentication if you encounter this problem.},
'_FURTHER_NOTES_DESC_5' => q{When using cssh on a large number of systems to connect back to a single system (e.g. you issue a command to the cluster to scp a file from a given location) and when these connections require authentication (i.e. you are going to authenticate with a password), the sshd daemon at that location may refuse connects after the number specified by MaxStartups in sshd_config is exceeded. (If this value is not set, it defaults to 10.) This is expected behavior; sshd uses this mechanism to prevent DoS attacks from unauthenticated sources. Please tune sshd_config and reload the SSH daemon, or consider using the ~/.ssh/authorized_keys mechanism for authentication if you encounter this problem.},
'_FURTHER_NOTES_6' => q{If client windows fail to open, try running:
'_FURTHER_NOTES_DESC_6' => q{If client windows fail to open, try running:
C<< cssh -e {single host name} >>
@ -31,6 +31,45 @@ This will test the mechanisms used to open windows to hosts. This could be due
'_OPTIONS' => q{Some of these options may also be defined within the configuration file. Default options are shown as appropriate.
},
'_ARGUMENTS' => q{The following arguments are supported:},
# note: escape the [ and ] with a ~
'_ARGUMENTS_NAME_1' => q{~[user@~]<hostname>~[:port~] ...},
'_ARGUMENTS_DESC_1' => q{Open an xterm to the given hostname and connect to the administration console. An optional port number can be used if sshd is not listening on the standard port (i.e., not listening on port 22) and ssh_config cannot be used.},
'_ARGUMENTS_NAME_2' => q{<tag> ...},
'_ARGUMENTS_DESC_2' => q{Open a series of xterms defined by <tag> in one of the supplementary configuration files (see "FILES").
Note: specifying a username on a cluster tag will override any usernames defined in the cluster},
'_KEY_SHORTCUTS' => q{The following key shortcuts are available within the console window, and all of them may be changed via the configuration files.},
'_KEY_SHORTCUTS_NAME_1' => q{Control-q},
'_KEY_SHORTCUTS_DESC_1' => q{Quit the program and close all connections and windows.},
'_KEY_SHORTCUTS_NAME_2' => q{Control-+},
'_KEY_SHORTCUTS_DESC_2' => q{Open the 'Add Host(s) or Cluster(s)' dialogue box. Multiple host or cluster names can be entered, separated by spaces.},
'_KEY_SHORTCUTS_NAME_3' => q{Alt-n},
'_KEY_SHORTCUTS_DESC_3' => q{Paste in the hostname part of the specific connection string to each client, minus any username or port, e.g.
C<< scp /etc/hosts server:files/<Alt-n>.hosts >>
would replace the <Alt-n> with the client's name in each window.},
'_KEY_SHORTCUTS_NAME_4' => q{Alt-r},
'_KEY_SHORTCUTS_DESC_4' => q{Retile all the client windows.},
'_EXAMPLES' => q{ },
'_EXAMPLES_NAME_1' => q{Open up a session to 3 servers},
'_EXAMPLES_DESC_1' => q{S<$ cssh server1 server2 server3>},
'_EXAMPLES_NAME_2' => q{Open up a session to a cluster of servers identified by the tag 'farm1' and give the controlling window a specific title, where the cluster is defined in one of the default configuration files},
'_EXAMPLES_DESC_2' => q{S<$ cssh -T 'Web Farm Cluster 1' farm1>},
'_EXAMPLES_NAME_3' => q{Connect to different servers using different login names. NOTE: this can also be achieved by setting up appropriate options in the F<.ssh/config> file. Do not close cssh when the last terminal exits.},
'_EXAMPLES_DESC_3' => q{S<$ cssh -Q user1@server1 admin@server2>},
'_EXAMPLES_NAME_4' => q{Open up a cluster defined in a non-default configuration file},
'_EXAMPLES_DESC_4' => q{S<$ cssh -c $HOME/cssh.config db_cluster>},
'_EXAMPLES_NAME_5' => q{Use telnet on port 2022 instead of ssh},
'_EXAMPLES_DESC_5' => q{S<$ ctel -p 2022 server1 server2>},
'_EXAMPLES_NAME_7' => q{Use rsh instead of ssh},
'_EXAMPLES_DESC_7' => q{S<$ crsh server1 server2>},
'_EXAMPLES_NAME_8' => q{Use console with master as the primary server instead of ssh},
'_EXAMPLES_DESC_8' => q{S<$ ccon -M master server1 server2>},
);
1;