Skip to content

Commit

Permalink
Add examples to help message
Browse files Browse the repository at this point in the history
  • Loading branch information
jessp01 committed Jul 19, 2023
1 parent 1334851 commit a861c28
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 0 additions & 2 deletions utils/functions.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ if which zaje > /dev/null 2>&1 ;then
#if echo $FILE | grep -q nginx || echo $FILE | grep -q apache;then
#fi

echo "$(which tail) "$@" | zaje -l server-log"

if [ $1 == "-f" ];then
$(which tail) "$@" | zaje -l server-log -
else
Expand Down
26 changes: 26 additions & 0 deletions zaje.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,32 @@ func handleData(filename string, data []byte) {
func main() {

app := cli.NewApp()
cli.AppHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[input-file || - ]{{end}}
{{if len .Authors}}
COMMANDS:
{{range .Commands}}{{if not .HideHelp}} {{join .Names ", "}}{{ "\t"}}{{.Usage}}{{ "\n" }}{{end}}{{end}}{{end}}{{if .VisibleFlags}}
GLOBAL OPTIONS:
{{range .VisibleFlags}}{{.}}{{ "\n" }}
{{end}}{{end}}{{if .Copyright }}
EXAMPLES:
To use zaje as a cat replacement:
$ zaje /path/to/file
To replace tail -f:
$ tail -f /path/to/file | zaje -l server-log -
(- will make zaje read progressively from STDIN)
AUTHOR:
{{range .Authors}}{{ . }}{{end}}
{{end}}{{if .Commands}}
COPYRIGHT:
{{.Copyright}}
{{end}}
`
app.Name = "zaje"
app.Usage = "Syntax highlighter to cover all your shell needs"
app.Version = "0.21.1-8"
Expand Down

0 comments on commit a861c28

Please sign in to comment.