Skip to content

Commit

Permalink
feat(exec): adding a flag that enables supress the output of the orig…
Browse files Browse the repository at this point in the history
…inal command
  • Loading branch information
propilideno committed Jan 13, 2025
1 parent 1c39063 commit af4af9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func execute(cmd *cobra.Command, args []string) (err error) {
command := strings.Join(commands, "; ")

// Show final command before executing it
fmt.Printf("> %s\n", command)
if !flag.Quiet {
fmt.Printf("> %s\n", command)
}

return run(command, os.Stdin, os.Stdout)
}
Expand All @@ -46,4 +48,6 @@ func init() {
`Initial value for query`)
execCmd.Flags().StringVarP(&config.Flag.FilterTag, "tag", "t", "",
`Filter tag`)
execCmd.Flags().BoolVarP(&config.Flag.Quiet, "silent", "s", false,
`Supress the command output`)
}
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type FlagConfig struct {
Tag bool
UseMultiLine bool
UseEditor bool
Quiet bool
}

// Load loads a config toml
Expand Down

0 comments on commit af4af9e

Please sign in to comment.