Browse Source

Updates help menu information

master
sloum 2 years ago
parent
commit
7a717a7b33
  1. 42
      main.go

42
main.go

@ -368,23 +368,41 @@ func get() {
func help(c string) {
c = strings.ToLower(c)
switch c {
case "general":
fmt.Println("Format:\n\tscbm \033[3mcommand\033[0m [option...] [argument...]")
fmt.Println("\nscbm is a compiled build manager for git repositories. The basic idea is to be able to manage items that are built from source and provide an easy mechanism to update/upgrade these programs. Typing `scbm help` and then a command will yield further help with that command. Available commands are:\n\n\tfreeze\n\tget\n\tinstall\n\tlist\n\trevert\n\tset\n\tupdate")
case "freeze":
fmt.Println("\033[1;4mFreeze\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm freeze [-trash] \033[3mprogram-name\033[0m")
fmt.Println("\033[1mAction:\033[0m\n\tWill freeze a program (prevent it from receiving further updates). \033[1mDOES NOT\033[0m delete any files or uninstall any programs. If the `-trash` flag is passed the repo will be removed from the scbm folder; this is not recommended unless you have properly uninstalled the program beforehand as `-trash` only removes the program from management by scbm. It does not remove or alter any files outside of the scbm folder.")
fmt.Println("\033[1;4mfreeze\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm freeze [-trash] \033[3mname...\033[0m")
fmt.Println("\033[1mAction:\033[0m\nWill freeze the given program(s) (prevent from receiving further updates). \033[1mDOES NOT\033[0m delete any files or uninstall any programs. If the `-trash` flag is passed the repo(s) will be removed from the scbm folder; this is not recommended unless you have properly uninstalled the program beforehand as `-trash` only removes the program from management by scbm. It does not remove or alter any files outside of the scbm folder. While a frozen program will not receive updates, it can still be installed with the `install` command or have its installation string updated with the `set` command.")
case "thaw":
fmt.Println("\033[1;4mThaw\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm thaw \033[3mprogram-name\033[0m")
fmt.Println("\033[1mAction:\033[0m\n\tWill reactivate a froven program, allowing it to receive updates with the `update` command.")
fmt.Println("\033[1;4mthaw\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm thaw \033[3mname...\033[0m")
fmt.Println("\033[1mAction:\033[0m\nWill reactivate the given frozen program(s), allowing it to receive updates with the `update` command.")
case "list":
fmt.Println("\033[1;4mList\033[0m")
fmt.Println("\033[1;4mlist\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm list")
fmt.Println("\033[1mAction:\033[0m\n\tWill output a table displaying all of the programs under scbm management showing the program name, the discription, and the programs freeze status.")
fmt.Println("\033[1mAction:\033[0m\nWill output a table displaying all of the programs under scbm management showing the program name, the discription, and the program's freeze status.")
case "get":
fmt.Println("\033[1;4mGet\033[0m")
fmt.Println("")
fmt.Println("\033[1;4mget\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm get \033[3mclone-url\033[0m [name]")
fmt.Println("\033[1mAction:\033[0m\n\tWill attempt to clone the repo at the given url into the sbm staging folder and add the program to the scbm databse. The name field will default to the new repo name, but can be replaced by a name passed in as the final argument to the get command. The current HEAD of the master branch will be set as the current commit.")
fmt.Println("\033[1mAction:\033[0m\nWill attempt to clone the repo at the given url into the scbm staging folder and add the program to the scbm databse. The name field will default to the new repo name, but can be replaced by a name passed in as the final argument to the get command. The current HEAD of the master branch will be set as the current commit.")
case "update":
fmt.Println("\033[1;4mupdate\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm update \033[3m[name...]\033[0m")
fmt.Println("\033[1mAction:\033[0m\nWill update the given program(s). Absent a program list scbm will try to update all of the programs it manages. Updating consists of pulling each git repository and updating the current hash for the program and moving the previous current to be set as `previous`, allowing a revert if desired.")
case "install":
fmt.Println("\033[1;4minstall\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm install \033[3mname...\033[0m")
fmt.Println("\033[1mAction:\033[0m\nWill run the install command string for the given program name(s). If a program has an empty command string, no action will be taken. User's should watch the output for any errors that their install command strings may report so that they can be fixed.")
case "set":
fmt.Println("\033[1;4mset\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm set \033[3mname command-string\033[0m")
fmt.Println("\033[1mAction:\033[0m\nWill set the install command for the given program to the given command-string.")
case "revert":
fmt.Println("\033[1;4mrevert\033[0m")
fmt.Println("\033[1mFormat:\033[0m\n\tscbm revert [-swap] \033[3mname\033[0m")
fmt.Println("\033[1mAction:\033[0m\nWill set the branch of the given program to the previously stored commit hash, if one exists. If the swap flag is passed, the current commit hash and the previous will swap places. If a program is successfully reverted, it will automatically be frozen and installed. This is useful to return the program to a known working state.")
default:
fmt.Printf("No help exists for %q...\n", c)
}
@ -546,7 +564,7 @@ func upgrade() {
}
// revert moves a programs HEAD back to the previously used commit,
// revert moves a program's HEAD back to the previously used commit,
// if one exists. It moves the current commit ID to that commit and
// runs the install script. It then freezes the program so-as to stay
// on that commit.

Loading…
Cancel
Save