From 0f4777f37d23b07249eb1493c68c1f9d91d5b904 Mon Sep 17 00:00:00 2001 From: verzac Date: Thu, 1 Feb 2024 23:47:26 +0700 Subject: [PATCH] update README and n-cli run command help --- README.md | 18 ++++++++++-------- cmd/cmd_run.go | 11 +++++++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index df16caf..b8a6515 100644 --- a/README.md +++ b/README.md @@ -41,21 +41,23 @@ n-cli --help n-cli send My message here n-cli s My message here -# where is your config? -n-cli where config - # example - make build takes 20 minutes to complete make build; n-cli s "Build is done, stop making coffee" +# alternatively, run your shell command through n-cli +n-cli run make build + +# make sure to use `--` if you'd like to pass in flags +n-cli r -- make build --whatever-args-i-have-here + # pro tip: you can set an alias to make the whole command shorter alias n="n-cli s" make build; n Build is done; -# optional: initializes & configures n-cli without running anything -n-cli init - -# get version -n-cli version +# useful commands +n-cli init # optional: initializes & configures n-cli without running anything +n-cli where config # where is your config? +n-cli version # get version ``` # 📝 Configuration diff --git a/cmd/cmd_run.go b/cmd/cmd_run.go index 1feb18b..6dbce32 100644 --- a/cmd/cmd_run.go +++ b/cmd/cmd_run.go @@ -14,8 +14,15 @@ func NewRunCmd() *cobra.Command { Use: "run", Aliases: []string{"r"}, Args: cobra.MinimumNArgs(1), - Short: "Runs arbitrary shell commands through n-cli.", - Long: "Runs arbitrary shell commands. For example, `n-cli run echo Hello, world!` If you'd like to pass in flags to your shell command, use `n-cli run mycommand -- --flag1=true --flag2`.", + Short: "Run shell commands and get notified once it's done.", + Long: `Runs arbitrary shell commands. Once it finishes, n-cli will send a notification to you. It will also capture useful metrics such as the time it took for your command to complete. + +Example: n-cli run echo Hello, world! + +If you'd like to pass in flags to your shell command, use n-cli run mycommand -- --flag1=true --flag2. + +Do note that some metrics may be missing on Windows (open a PR if you are interested in implementing them). +`, Run: func(cobraCmd *cobra.Command, args []string) { command := args[0] commandArgs := args[1:]