Skip to content

remove pointless sprintfs from doc strings #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func init() {
}

func CryptoHelp() string {
return fmt.Sprintf("search for crypto constants using yara rules with ret\n")
return "search for crypto constants using yara rules with ret\n"
}

func Crypto(args []string) {
Expand Down
2 changes: 1 addition & 1 deletion commands/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {
}

func DockerHelp() string {
return fmt.Sprintf("create a dockerfile from a template with ret\n")
return "create a dockerfile from a template with ret\n"
}

func makeDockerFile(port int) {
Expand Down
2 changes: 1 addition & 1 deletion commands/ghidra.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func init() {
}

func GhidraHelp() string {
return fmt.Sprintf("ingests all added files then opens ghidra with ret\n")
return "ingests all added files then opens ghidra with ret\n"
}

func ghidraSpinner() {
Expand Down
4 changes: 2 additions & 2 deletions commands/gist.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func init() {
}

func GistHelp() string {
return fmt.Sprintf("make private gists with ret\n") +
fmt.Sprintf(theme.ColorGray+"specify the path of one or more files to upload"+theme.ColorReset+"\n")
return "make private gists with ret\n" +
theme.ColorGray + "specify the path of one or more files to upload" + theme.ColorReset + "\n"
}

func Gist(args []string) {
Expand Down
2 changes: 1 addition & 1 deletion commands/ida.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {
}

func IdaHelp() string {
return fmt.Sprintf("opens all added files then opens ida with ret\n")
return "opens all added files then opens ida with ret\n"
}

func idaSpinner() {
Expand Down
8 changes: 4 additions & 4 deletions commands/libc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func init() {
}

func LibcHelp() string {
return fmt.Sprintf("get a version of libc by copying it from a docker container with ret\n") +
fmt.Sprintf(theme.ColorGray+"specify an image tag like \"ubuntu:24.04\" to get a specific version"+theme.ColorReset+"\n") +
fmt.Sprintf(theme.ColorGray+"without args this command will use the tag \"ubuntu:latest\""+theme.ColorReset+"\n") +
fmt.Sprintf(theme.ColorGray+"the file will be copied to the cwd and added with ret"+theme.ColorReset+"\n")
return "get a version of libc by copying it from a docker container with ret\n" +
theme.ColorGray + "specify an image tag like \"ubuntu:24.04\" to get a specific version" + theme.ColorReset + "\n" +
theme.ColorGray + "without args this command will use the tag \"ubuntu:latest\"" + theme.ColorReset + "\n" +
theme.ColorGray + "the file will be copied to the cwd and added with ret" + theme.ColorReset + "\n"
}

func libcSpinner(stop chan bool) {
Expand Down
4 changes: 2 additions & 2 deletions commands/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func init() {
}

func NotesHelp() string {
return fmt.Sprintf("take notes with ret\n") +
fmt.Sprintf(theme.ColorGray+"use - to read from stdin"+theme.ColorReset+"\n")
return "take notes with ret\n" +
theme.ColorGray + "use - to read from stdin" + theme.ColorReset + "\n"
}

func displayNotes() {
Expand Down
2 changes: 1 addition & 1 deletion commands/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func init() {
}

func ProxyHelp() string {
return fmt.Sprintf("manage proxies with ret\n")
return "manage proxies with ret\n"
}

func proxyList() {
Expand Down
3 changes: 1 addition & 2 deletions commands/sage.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package commands

import (
"fmt"
"log"
"os"
"os/exec"
Expand All @@ -18,7 +17,7 @@ func init() {
}

func SageHelp() string {
return fmt.Sprintf("open sage with ret\n")
return "open sage with ret\n"
}

func Sage(args []string) {
Expand Down
2 changes: 1 addition & 1 deletion commands/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func init() {
}

func StatusHelp() string {
return fmt.Sprintf("displays the status for the current task with ret\n")
return "displays the status for the current task with ret\n"
}

func Status(args []string) {
Expand Down
21 changes: 9 additions & 12 deletions commands/syscall.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package commands

import (
"fmt"
"log"
"ret/theme"
"ret/util"
Expand All @@ -28,17 +27,15 @@ func init() {
}

func SyscallHelp() string {
return fmt.Sprintf("check syscalls by regex with ret\n") +

fmt.Sprintf(theme.ColorBlue+"\n uses"+theme.ColorGray+": \n") +
fmt.Sprintf(theme.ColorGreen+" x86"+theme.ColorGray+": /usr/include/x86_64-linux-gnu/asm/unistd_32.h"+theme.ColorReset+"\n") +
fmt.Sprintf(theme.ColorGreen+" x64"+theme.ColorGray+": /usr/include/x86_64-linux-gnu/asm/unistd_64.h"+theme.ColorReset+"\n") +

fmt.Sprintf(theme.ColorBlue+"\n examples"+theme.ColorGray+": \n") +
fmt.Sprintf(theme.ColorPurple+" syscall x64 \" 0\""+theme.ColorReset+"\n") +
fmt.Sprintf(theme.ColorPurple+" syscall x64 write"+theme.ColorReset+"\n") +
fmt.Sprintf(theme.ColorPurple+" syscall 32 read"+theme.ColorReset+"\n") +
fmt.Sprintf(theme.ColorPurple+" syscall x86 10[0-9]"+theme.ColorReset+"\n\n")
return "check syscalls by regex with ret\n" +
theme.ColorBlue + "\n uses" + theme.ColorGray + ": \n" +
theme.ColorGreen + " x86" + theme.ColorGray + ": /usr/include/x86_64-linux-gnu/asm/unistd_32.h" + theme.ColorReset + "\n" +
theme.ColorGreen + " x64" + theme.ColorGray + ": /usr/include/x86_64-linux-gnu/asm/unistd_64.h" + theme.ColorReset + "\n" +
theme.ColorBlue + "\n examples" + theme.ColorGray + ": \n" +
theme.ColorPurple + " syscall x64 \" 0\"" + theme.ColorReset + "\n" +
theme.ColorPurple + " syscall x64 write" + theme.ColorReset + "\n" +
theme.ColorPurple + " syscall 32 read" + theme.ColorReset + "\n" +
theme.ColorPurple + " syscall x86 10[0-9]" + theme.ColorReset + "\n\n"
}

func Syscall(args []string) {
Expand Down
2 changes: 1 addition & 1 deletion commands/vps.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func init() {
}

func VpsHelp() string {
return fmt.Sprintf("create and manage google cloud compute instances with ret\n")
return "create and manage google cloud compute instances with ret\n"
}

func createVps() string {
Expand Down