From 1d96751bb90006ea0771f5158e84a0b9fe2710c9 Mon Sep 17 00:00:00 2001
From: Nathan Yee <nyee32@schedmd.com>
Date: Thu, 15 Dec 2016 08:36:20 -0700
Subject: [PATCH] Improve documentation of interactive commands

Identify command options that can only be used in interactive mode
  and not on the initial command line.
bug 2069
---
 doc/man/man1/sacctmgr.1 |  45 +++++++++-------
 doc/man/man1/scontrol.1 | 116 +++++++++++++++++++++-------------------
 2 files changed, 87 insertions(+), 74 deletions(-)

diff --git a/doc/man/man1/sacctmgr.1 b/doc/man/man1/sacctmgr.1
index fa022970823..ed1089b366b 100644
--- a/doc/man/man1/sacctmgr.1
+++ b/doc/man/man1/sacctmgr.1
@@ -107,11 +107,6 @@ Delete the specified entities.
 Dump cluster data to the specified file. If the filename is not specified
 it uses clustername.cfg filename by default.
 
-.TP
-\fBexit\fP
-Terminate sacctmgr interactive mode.
-Identical to the \fBquit\fR command.
-
 .TP
 \fBhelp\fP
 Display a description of sacctmgr options and commands.
@@ -137,15 +132,6 @@ Modify an entity.
 \fBproblem\fP
 Use with show or list to display entity problems.
 
-.TP
-\fBquiet\fP
-Print no messages other than error messages.
-
-.TP
-\fBquit\fP
-Terminate the execution of sacctmgr interactive mode.
-Identical to the \fBexit\fR command.
-
 .TP
 \fBreconfigure\fR
 Reconfigures the SlurmDBD if running with one.
@@ -161,15 +147,36 @@ Identical to the \fBlist\fR command.
 \fBshutdown\fR
 Shutdown the server.
 
+.TP
+\fBversion\fP
+Display the version number of sacctmgr.
+
+.SH "INTERACTIVE COMMANDS"
+
+\fBNOTE:\fP
+All commands listed below can be used in the interactive mode, but \fINOT\fP
+on the initial command line.
+
+.TP
+\fBexit\fP
+Terminate sacctmgr interactive mode.
+Identical to the \fBquit\fR command.
+
+.TP
+\fBquiet\fP
+Print no messages other than error messages.
+
+.TP
+\fBquit\fP
+Terminate the execution of sacctmgr interactive mode.
+Identical to the \fBexit\fR command.
+
 .TP
 \fBverbose\fP
 Enable detailed logging.
 This includes time\-stamps on data structures, record counts, etc.
-This is an independent command with no options meant for use in interactive mode.
-
-.TP
-\fBversion\fP
-Display the version number of sacctmgr.
+This is an independent command with no options meant for use in
+interactive mode.
 
 .TP
 \fB!!\fP
diff --git a/doc/man/man1/scontrol.1 b/doc/man/man1/scontrol.1
index 63c92561e53..cd2305137c6 100644
--- a/doc/man/man1/scontrol.1
+++ b/doc/man/man1/scontrol.1
@@ -67,16 +67,11 @@ Print version information and exit.
 .TP
 \fBCOMMANDS\fR
 
-.TP
-\fBall\fP
-Show all partitions, their jobs and jobs steps. This causes information to be
-displayed about partitions that are configured as hidden and partitions that
-are unavailable to user's group.
-
 .TP
 \fBabort\fP
 Instruct the Slurm controller to terminate immediately and generate a core file.
-See "man slurmctld" for information about where the core file will be written.
+See "man slurmctld" for information about where the core file will be
+written.
 
 .TP
 \fBcheckpoint\fP \fICKPT_OP\fP \fIID\fP
@@ -155,39 +150,14 @@ The two \fISPECIFICATION\fP choices are \fIPartitionName=<name>\fP and
 no associated jobs at the time of their deletion (modify the job's first).
 If the specified partition is in use, the request is denied.
 
-.TP
-\fBdetails\fP
-Causes the \fIshow\fP command to provide additional details where available.
-Job information will include CPUs and NUMA memory allocated on each node.
-Note that on computers with hyperthreading enabled and Slurm configured to
-allocate cores, each listed CPU represents one physical core.
-Each hyperthread on that core can be allocated a separate task, so a job's
-CPU count and task count may differ.
-See the \fB\-\-cpu_bind\fR and \fB\-\-mem_bind\fR option descriptions in
-srun man pages for more information.
-The \fBdetails\fP option is currently only supported for the \fIshow job\fP
-command. To also list the batch script for batch jobs, in addition to the
-details, use the \fBscript\fP option described below instead of this option.
-
 .TP
 \fBerrnumstr\fP \fIERRNO\fP
 Given a Slurm error number, return a descriptive string.
 
-.TP
-\fBexit\fP
-Terminate the execution of scontrol.
-This is an independent command with no options meant for use in interactive mode.
-
 .TP
 \fBhelp\fP
 Display a description of scontrol options and commands.
 
-.TP
-\fBhide\fP
-Do not display partition, job or jobs step information for partitions that are
-configured as hidden or partitions that are unavailable to the user's group.
-This is the default behavior.
-
 .TP
 \fBhold\fP \fIjob_list\fP
 Prevent a pending job from beginning started (sets it's priority to 0).
@@ -205,10 +175,6 @@ be released by the job's owner.
 Send a message to standard error of the salloc or srun command or batch job
 associated with the specified \fIjob_id\fP.
 
-.TP
-\fBoneliner\fP
-Print information one line per record.
-
 .TP
 \fBpidinfo\fP \fIproc_id\fP
 Print the Slurm job id and scheduled termination time corresponding to the
@@ -236,14 +202,6 @@ one host are, in general, only used by Slurm developers.
 Ping the primary and secondary slurmctld daemon and report if
 they are responding.
 
-.TP
-\fBquiet\fP
-Print no warning or informational messages, only fatal error messages.
-
-.TP
-\fBquit\fP
-Terminate the execution of scontrol.
-
 .TP
 \fBreboot\fP [ASAP] [\fINodeList\fP]
 Reboot all nodes in the system when they become idle using the
@@ -331,12 +289,6 @@ daemon reads the slurm.conf configuration file (e.g. when the daemon
 is restarted or \fBscontrol reconfigure\fR is executed) if the
 SlurmSchedLogLevel parameter is present.
 
-.TP
-\fBscript\fP
-Causes the \fIshow job\fP command to list the batch script for batch
-jobs in addition to the detail information described under the
-\fBdetails\fP option above.
-
 .TP
 \fBsetdebug\fP \fILEVEL\fP
 Change the debug level of the slurmctld daemon.
@@ -479,11 +431,6 @@ the physical addition or removal of nodes from the cluster may only be
 accomplished through editing the Slurm configuration file and executing
 the \fIreconfigure\fP command (described above).
 
-.TP
-\fBverbose\fP
-Print detailed event logging.
-This includes time\-stamps on data structures, record counts, etc.
-
 .TP
 \fBversion\fP
 Display the version number of scontrol being executed.
@@ -501,6 +448,65 @@ Write the current configuration to a file with the naming convention of
 "slurm.conf.<datetime>" in the same directory as the original slurm.conf
 file.
 
+.TP
+\fBINTERACTIVE COMMANDS\fR
+\fBNOTE:\fP
+All commands listed below can be used in the interactive mode, but \fINOT\fP
+on the initial command line.
+
+.TP
+\fBall\fP
+Show all partitions, their jobs and jobs steps. This causes information to be
+displayed about partitions that are configured as hidden and partitions that
+are unavailable to user's group.
+
+.TP
+\fBdetails\fP
+Causes the \fIshow\fP command to provide additional details where available.
+Job information will include CPUs and NUMA memory allocated on each node.
+Note that on computers with hyperthreading enabled and Slurm configured to
+allocate cores, each listed CPU represents one physical core.
+Each hyperthread on that core can be allocated a separate task, so a job's
+CPU count and task count may differ.
+See the \fB\-\-cpu_bind\fR and \fB\-\-mem_bind\fR option descriptions in
+srun man pages for more information.
+The \fBdetails\fP option is currently only supported for the \fIshow job\fP
+command. To also list the batch script for batch jobs, in addition to the
+details, use the \fBscript\fP option described below instead of this option.
+
+.TP
+\fBexit\fP
+Terminate scontrol interactive session.
+
+.TP
+\fBhide\fP
+Do not display partition, job or jobs step information for partitions that are
+configured as hidden or partitions that are unavailable to the user's group.
+This is the default behavior.
+
+.TP
+\fBoneliner\fP
+Print information one line per record.
+
+.TP
+\fBquiet\fP
+Print no warning or informational messages, only fatal error messages.
+
+.TP
+\fBquit\fP
+Terminate the execution of scontrol.
+
+.TP
+\fBscript\fP
+Causes the \fIshow job\fP command to list the batch script for batch
+jobs in addition to the detail information described under the
+\fBdetails\fP option above.
+
+.TP
+\fBverbose\fP
+Print detailed event logging.
+This includes time\-stamps on data structures, record counts, etc.
+
 .TP
 \fB!!\fP
 Repeat the last command executed.
-- 
GitLab