Skip to content

Commit

Permalink
cmd: rework some flag descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleam committed Aug 21, 2024
1 parent 235d6a7 commit aef4f1e
Show file tree
Hide file tree
Showing 19 changed files with 220 additions and 220 deletions.
2 changes: 1 addition & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewInitCmd() *cobra.Command {
}

const directory string = "dir"
cmd.Flags().StringSlice(directory, []string{}, "A directory in which to look for NONMEM Installations")
cmd.Flags().StringSlice(directory, []string{}, "directory in which to look for NONMEM installations")

return cmd
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ func NewLocalCmd() *cobra.Command {
}

childDirIdentifier := "create_child_dirs"
cmd.PersistentFlags().Bool(childDirIdentifier, true, "Indicates whether or not local branch execution"+
"should create a new subdirectory with the output_dir variable as its name and execute in that directory")
cmd.PersistentFlags().Bool(childDirIdentifier, true,
"create a new subdirectory, named based on the output_dir option, for execution")
errpanic(viper.BindPFlag("local."+childDirIdentifier, cmd.PersistentFlags().Lookup(childDirIdentifier)))

return cmd
Expand Down
28 changes: 14 additions & 14 deletions cmd/nonmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,63 +180,63 @@ func NewNonmemCmd() *cobra.Command {

// NM Selector
const nmVersionIdentifier string = "nm_version"
cmd.PersistentFlags().String(nmVersionIdentifier, "", "Version of NONMEM from the configuration list to use")
cmd.PersistentFlags().String(nmVersionIdentifier, "", "version of NONMEM from the configuration list to use")
errpanic(viper.BindPFlag(nmVersionIdentifier, cmd.PersistentFlags().Lookup(nmVersionIdentifier)))

// Parallelization Components
const parallelIdentifier string = "parallel"
cmd.PersistentFlags().Bool(parallelIdentifier, false, "Whether or not to run NONMEM in parallel mode")
cmd.PersistentFlags().Bool(parallelIdentifier, false, "whether to run NONMEM in parallel mode")
errpanic(viper.BindPFlag(parallelIdentifier, cmd.PersistentFlags().Lookup(parallelIdentifier)))

const parallelCompletionTimeoutIdentifier string = "parallel_timeout"
cmd.PersistentFlags().Int(parallelCompletionTimeoutIdentifier, 2147483647, "The amount of time to wait for parallel operations in NONMEM before timing out")
cmd.PersistentFlags().Int(parallelCompletionTimeoutIdentifier, 2147483647, "amount of time to wait for parallel operations in NONMEM before timing out")
errpanic(viper.BindPFlag(parallelCompletionTimeoutIdentifier, cmd.PersistentFlags().Lookup(parallelCompletionTimeoutIdentifier)))

const mpiExecPathIdentifier string = "mpi_exec_path"
cmd.PersistentFlags().String(mpiExecPathIdentifier, "/usr/local/mpich3/bin/mpiexec", "The fully qualified path to mpiexec. Used for NONMEM parallel operations")
cmd.PersistentFlags().String(mpiExecPathIdentifier, "/usr/local/mpich3/bin/mpiexec", "fully qualified path to mpiexec to use for NONMEM parallel operations")
errpanic(viper.BindPFlag(mpiExecPathIdentifier, cmd.PersistentFlags().Lookup(mpiExecPathIdentifier)))

const parafileIdentifier string = "parafile"
cmd.PersistentFlags().String(parafileIdentifier, "", "Location of a user-provided parafile to use for parallel execution")
cmd.PersistentFlags().String(parafileIdentifier, "", "location of a user-provided parafile to use for parallel execution")
errpanic(viper.BindPFlag(parafileIdentifier, cmd.PersistentFlags().Lookup(parafileIdentifier)))

const nmQualIdentifier string = "nmqual"
cmd.PersistentFlags().Bool(nmQualIdentifier, false, "Whether or not to execute with nmqual (autolog.pl)")
cmd.PersistentFlags().Bool(nmQualIdentifier, false, "whether to execute with nmqual (autolog.pl)")
errpanic(viper.BindPFlag(nmQualIdentifier, cmd.PersistentFlags().Lookup(nmQualIdentifier)))

// NMFE Options
const nmfeGroup string = "nmfe_options"
const licFileIdentifier string = "licfile"
cmd.PersistentFlags().String(licFileIdentifier, "", "RAW NMFE OPTION - Specify a license file to use with NMFE (NONMEM)")
cmd.PersistentFlags().String(licFileIdentifier, "", "RAW NMFE OPTION - NONMEM license file to use")
errpanic(viper.BindPFlag(nmfeGroup+"."+licFileIdentifier, cmd.PersistentFlags().Lookup(licFileIdentifier)))

const prSameIdentifier string = "prsame"
cmd.PersistentFlags().Bool(prSameIdentifier, false, "RAW NMFE OPTION - Indicates to NONMEM that the PREDPP compilation step should be skipped")
cmd.PersistentFlags().Bool(prSameIdentifier, false, "RAW NMFE OPTION - tell NONMEM to skip the PREDPP compilation step")
errpanic(viper.BindPFlag(nmfeGroup+"."+prSameIdentifier, cmd.PersistentFlags().Lookup(prSameIdentifier)))

const backgroundIdentifier string = "background"
cmd.PersistentFlags().Bool(backgroundIdentifier, false, "RAW NMFE OPTION - Tells NONMEM not to scan StdIn for control characters")
cmd.PersistentFlags().Bool(backgroundIdentifier, false, "RAW NMFE OPTION - tell NONMEM not to scan stdin for control characters")
errpanic(viper.BindPFlag(nmfeGroup+"."+backgroundIdentifier, cmd.PersistentFlags().Lookup(backgroundIdentifier)))

const prCompileIdentifier string = "prcompile"
cmd.PersistentFlags().Bool(prCompileIdentifier, false, "RAW NMFE OPTION - Forces PREDPP compilation")
cmd.PersistentFlags().Bool(prCompileIdentifier, false, "RAW NMFE OPTION - forces PREDPP compilation")
errpanic(viper.BindPFlag(nmfeGroup+"."+prCompileIdentifier, cmd.PersistentFlags().Lookup(prCompileIdentifier)))

const prDefaultIdentifier string = "prdefault"
cmd.PersistentFlags().Bool(prDefaultIdentifier, false, "RAW NMFE OPTION - Do not recompile any routines other than FSUBS")
cmd.PersistentFlags().Bool(prDefaultIdentifier, false, "RAW NMFE OPTION - do not recompile any routines other than FSUBS")
errpanic(viper.BindPFlag(nmfeGroup+"."+prDefaultIdentifier, cmd.PersistentFlags().Lookup(prDefaultIdentifier)))

const tprDefaultIdentifier string = "tprdefault"
cmd.PersistentFlags().Bool(tprDefaultIdentifier, false, "RAW NMFE OPTION - Test if is okay to do -prdefault")
cmd.PersistentFlags().Bool(tprDefaultIdentifier, false, "RAW NMFE OPTION - test if is okay to do -prdefault")
errpanic(viper.BindPFlag(nmfeGroup+"."+tprDefaultIdentifier, cmd.PersistentFlags().Lookup(tprDefaultIdentifier)))

const noBuildIdentifier string = "nobuild"
cmd.PersistentFlags().Bool(noBuildIdentifier, false, "RAW NMFE OPTION - Skips recompiling and rebuilding on NONMEM executable")
cmd.PersistentFlags().Bool(noBuildIdentifier, false, "RAW NMFE OPTION - do not build a new NONMEM executable")
errpanic(viper.BindPFlag(nmfeGroup+"."+noBuildIdentifier, cmd.PersistentFlags().Lookup(noBuildIdentifier)))

const maxLimIdentifier string = "maxlim"
cmd.PersistentFlags().Int(maxLimIdentifier, 2,
"RAW NMFE OPTION - Set the maximum values for the buffers used by NONMEM (if 0, don't pass -maxlim to nmfe)")
"RAW NMFE OPTION - set the maximum values for the buffers used by NONMEM (if 0, don't pass -maxlim to nmfe)")
errpanic(viper.BindPFlag(nmfeGroup+"."+maxLimIdentifier, cmd.PersistentFlags().Lookup(maxLimIdentifier)))

cmd.AddCommand(NewCleanCmd())
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func NewRootCmd() *cobra.Command {
cmd.PersistentFlags().IntVar(&threads, "threads", 4, "number of threads to execute with locally or nodes to execute on in parallel")
errpanic(viper.BindPFlag("threads", cmd.PersistentFlags().Lookup("threads"))) // Update to make sure viper binds to the flag

cmd.PersistentFlags().BoolVar(&Json, "json", false, "json tree of output, if possible")
cmd.PersistentFlags().BoolVar(&Json, "json", false, "show JSON output, if possible")
errpanic(viper.BindPFlag("json", cmd.PersistentFlags().Lookup("json"))) // Bind to viper

cmd.PersistentFlags().BoolVarP(&preview, "preview", "p", false, "preview action, but don't actually run command")
Expand Down
16 changes: 8 additions & 8 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ func NewRunCmd() *cobra.Command {
viper.SetDefault("output_dir", "{{ .Name }}")

// Int Variables
cmd.PersistentFlags().Int("clean_lvl", 1, "clean level used for file output from a given (set of) runs")
cmd.PersistentFlags().Int("clean_lvl", 1, "clean level used for output")
errpanic(viper.BindPFlag("clean_lvl", cmd.PersistentFlags().Lookup("clean_lvl")))
// TODO: these are likely not meangingful as should be set in configlib, but want to configm
viper.SetDefault("clean_lvl", 1)

cmd.PersistentFlags().Int("copy_lvl", 0, "copy level used for file output from a given (set of) runs")
cmd.PersistentFlags().Int("copy_lvl", 0, "copy level used for output")
errpanic(viper.BindPFlag("copy_lvl", cmd.PersistentFlags().Lookup("copy_lvl")))
viper.SetDefault("copy_lvl", 0)

Expand All @@ -98,32 +98,32 @@ func NewRunCmd() *cobra.Command {
errpanic(viper.BindPFlag("git", cmd.PersistentFlags().Lookup("git")))
viper.SetDefault("git", true)

cmd.PersistentFlags().Bool("overwrite", false, "Whether or not to remove existing output directories if they are present")
cmd.PersistentFlags().Bool("overwrite", false, "whether to remove existing output directories")
errpanic(viper.BindPFlag("overwrite", cmd.PersistentFlags().Lookup("overwrite")))
viper.SetDefault("overwrite", false)

const configIdentifier string = "config"
cmd.PersistentFlags().String(configIdentifier, "", "Path (relative or absolute) to another bbi.yaml to load")
cmd.PersistentFlags().String(configIdentifier, "", "path to another bbi.yaml to load")
errpanic(viper.BindPFlag(configIdentifier, cmd.PersistentFlags().Lookup(configIdentifier)))

const saveconfig string = "save_config"
cmd.PersistentFlags().Bool(saveconfig, true, "Whether or not to save the existing configuration to a file with the model")
cmd.PersistentFlags().Bool(saveconfig, true, "whether to save the existing configuration to the output directory")
errpanic(viper.BindPFlag(saveconfig, cmd.PersistentFlags().Lookup(saveconfig)))

const delayIdentifier string = "delay"
cmd.PersistentFlags().Int(delayIdentifier, 0, "Selects a random number of seconds between 1 and this value to stagger / jitter job execution. Assists in dealing with large volumes of work dealing with the same data set. May avoid NMTRAN issues about not being able read / close files")
errpanic(viper.BindPFlag(delayIdentifier, cmd.PersistentFlags().Lookup(delayIdentifier)))

const logFileIdentifier string = "log_file"
cmd.PersistentFlags().String(logFileIdentifier, "", "If populated, specifies the file into which to store the output / logging details from bbi")
cmd.PersistentFlags().String(logFileIdentifier, "", "file into which to store the output / logging details from bbi")
errpanic(viper.BindPFlag(logFileIdentifier, cmd.PersistentFlags().Lookup(logFileIdentifier)))

const postExecutionHookIdentifier string = "post_work_executable"
cmd.PersistentFlags().String(postExecutionHookIdentifier, "", "A script or binary to run when job execution completes or fails")
cmd.PersistentFlags().String(postExecutionHookIdentifier, "", "script or binary to run when job execution completes or fails")
errpanic(viper.BindPFlag(postExecutionHookIdentifier, cmd.PersistentFlags().Lookup(postExecutionHookIdentifier)))

const additionalEnvIdentifier string = "additional_post_work_envs"
cmd.PersistentFlags().StringSlice(additionalEnvIdentifier, []string{}, "Any additional values (as ENV KEY=VALUE) to provide for the post execution environment")
cmd.PersistentFlags().StringSlice(additionalEnvIdentifier, []string{}, "additional values (as ENV KEY=VALUE) to provide for the post execution environment")
errpanic(viper.BindPFlag(additionalEnvIdentifier, cmd.PersistentFlags().Lookup(additionalEnvIdentifier)))

cmd.AddCommand(NewLocalCmd())
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/bbi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ manage and execute models
```
-d, --debug debug mode
-h, --help help for bbi
--json json tree of output, if possible
--json show JSON output, if possible
-o, --output string output file
-p, --preview preview action, but don't actually run command
--threads int number of threads to execute with locally or nodes to execute on in parallel (default 4)
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/bbi_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ bbi init [flags]
### Options

```
--dir strings A directory in which to look for NONMEM Installations
--dir strings directory in which to look for NONMEM installations
-h, --help help for init
```

### Options inherited from parent commands

```
-d, --debug debug mode
--json json tree of output, if possible
--json show JSON output, if possible
-o, --output string output file
-p, --preview preview action, but don't actually run command
--threads int number of threads to execute with locally or nodes to execute on in parallel (default 4)
Expand Down
30 changes: 15 additions & 15 deletions docs/commands/bbi_nonmem.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ bbi nonmem [flags]
### Options

```
--background RAW NMFE OPTION - Tells NONMEM not to scan StdIn for control characters
--background RAW NMFE OPTION - tell NONMEM not to scan stdin for control characters
-h, --help help for nonmem
--licfile string RAW NMFE OPTION - Specify a license file to use with NMFE (NONMEM)
--maxlim int RAW NMFE OPTION - Set the maximum values for the buffers used by NONMEM (if 0, don't pass -maxlim to nmfe) (default 2)
--mpi_exec_path string The fully qualified path to mpiexec. Used for NONMEM parallel operations (default "/usr/local/mpich3/bin/mpiexec")
--nm_version string Version of NONMEM from the configuration list to use
--nmqual Whether or not to execute with nmqual (autolog.pl)
--nobuild RAW NMFE OPTION - Skips recompiling and rebuilding on NONMEM executable
--parafile string Location of a user-provided parafile to use for parallel execution
--parallel Whether or not to run NONMEM in parallel mode
--parallel_timeout int The amount of time to wait for parallel operations in NONMEM before timing out (default 2147483647)
--prcompile RAW NMFE OPTION - Forces PREDPP compilation
--prdefault RAW NMFE OPTION - Do not recompile any routines other than FSUBS
--prsame RAW NMFE OPTION - Indicates to NONMEM that the PREDPP compilation step should be skipped
--tprdefault RAW NMFE OPTION - Test if is okay to do -prdefault
--licfile string RAW NMFE OPTION - NONMEM license file to use
--maxlim int RAW NMFE OPTION - set the maximum values for the buffers used by NONMEM (if 0, don't pass -maxlim to nmfe) (default 2)
--mpi_exec_path string fully qualified path to mpiexec to use for NONMEM parallel operations (default "/usr/local/mpich3/bin/mpiexec")
--nm_version string version of NONMEM from the configuration list to use
--nmqual whether to execute with nmqual (autolog.pl)
--nobuild RAW NMFE OPTION - do not build a new NONMEM executable
--parafile string location of a user-provided parafile to use for parallel execution
--parallel whether to run NONMEM in parallel mode
--parallel_timeout int amount of time to wait for parallel operations in NONMEM before timing out (default 2147483647)
--prcompile RAW NMFE OPTION - forces PREDPP compilation
--prdefault RAW NMFE OPTION - do not recompile any routines other than FSUBS
--prsame RAW NMFE OPTION - tell NONMEM to skip the PREDPP compilation step
--tprdefault RAW NMFE OPTION - test if is okay to do -prdefault
```

### Options inherited from parent commands

```
-d, --debug debug mode
--json json tree of output, if possible
--json show JSON output, if possible
-o, --output string output file
-p, --preview preview action, but don't actually run command
--threads int number of threads to execute with locally or nodes to execute on in parallel (default 4)
Expand Down
30 changes: 15 additions & 15 deletions docs/commands/bbi_nonmem_clean.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ bbi nonmem clean [flags]
### Options inherited from parent commands

```
--background RAW NMFE OPTION - Tells NONMEM not to scan StdIn for control characters
--background RAW NMFE OPTION - tell NONMEM not to scan stdin for control characters
-d, --debug debug mode
--json json tree of output, if possible
--licfile string RAW NMFE OPTION - Specify a license file to use with NMFE (NONMEM)
--maxlim int RAW NMFE OPTION - Set the maximum values for the buffers used by NONMEM (if 0, don't pass -maxlim to nmfe) (default 2)
--mpi_exec_path string The fully qualified path to mpiexec. Used for NONMEM parallel operations (default "/usr/local/mpich3/bin/mpiexec")
--nm_version string Version of NONMEM from the configuration list to use
--nmqual Whether or not to execute with nmqual (autolog.pl)
--nobuild RAW NMFE OPTION - Skips recompiling and rebuilding on NONMEM executable
--json show JSON output, if possible
--licfile string RAW NMFE OPTION - NONMEM license file to use
--maxlim int RAW NMFE OPTION - set the maximum values for the buffers used by NONMEM (if 0, don't pass -maxlim to nmfe) (default 2)
--mpi_exec_path string fully qualified path to mpiexec to use for NONMEM parallel operations (default "/usr/local/mpich3/bin/mpiexec")
--nm_version string version of NONMEM from the configuration list to use
--nmqual whether to execute with nmqual (autolog.pl)
--nobuild RAW NMFE OPTION - do not build a new NONMEM executable
-o, --output string output file
--parafile string Location of a user-provided parafile to use for parallel execution
--parallel Whether or not to run NONMEM in parallel mode
--parallel_timeout int The amount of time to wait for parallel operations in NONMEM before timing out (default 2147483647)
--prcompile RAW NMFE OPTION - Forces PREDPP compilation
--prdefault RAW NMFE OPTION - Do not recompile any routines other than FSUBS
--parafile string location of a user-provided parafile to use for parallel execution
--parallel whether to run NONMEM in parallel mode
--parallel_timeout int amount of time to wait for parallel operations in NONMEM before timing out (default 2147483647)
--prcompile RAW NMFE OPTION - forces PREDPP compilation
--prdefault RAW NMFE OPTION - do not recompile any routines other than FSUBS
-p, --preview preview action, but don't actually run command
--prsame RAW NMFE OPTION - Indicates to NONMEM that the PREDPP compilation step should be skipped
--prsame RAW NMFE OPTION - tell NONMEM to skip the PREDPP compilation step
--threads int number of threads to execute with locally or nodes to execute on in parallel (default 4)
--tprdefault RAW NMFE OPTION - Test if is okay to do -prdefault
--tprdefault RAW NMFE OPTION - test if is okay to do -prdefault
-v, --verbose verbose output
```

Expand Down
Loading

0 comments on commit aef4f1e

Please sign in to comment.