Skip to content

Commit d41e0b9

Browse files
committed
Document --no-pty flag in help message
1 parent bb03870 commit d41e0b9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

main.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ import (
99
"github.com/godbus/dbus/v5"
1010
)
1111

12-
func nullTerminatedByteString(s string) []byte {
13-
return append([]byte(s), 0)
14-
}
12+
const USAGE = `Usage: %s [options] COMMAND [arguments...]
13+
14+
Accepted options:
15+
--no-pty do not allocate a pseudo-terminal for the host process
16+
`
1517

1618
// Version is the current value injected at build time.
1719
var Version string
1820

21+
func nullTerminatedByteString(s string) []byte {
22+
return append([]byte(s), 0)
23+
}
24+
1925
// Extract exit code from waitpid(2) status
2026
func interpretWaitStatus(status uint32) (int, bool) {
2127
// From /usr/include/bits/waitstatus.h
@@ -111,7 +117,7 @@ func runCommandSync(args []string, allocatePty bool) (int, error) {
111117

112118
func main() {
113119
if len(os.Args) < 2 || os.Args[1] == "-h" || os.Args[1] == "--help" {
114-
fmt.Fprintf(os.Stderr, "usage: %s command [arguments ...]", os.Args[0])
120+
fmt.Fprintf(os.Stderr, USAGE, os.Args[0])
115121
return
116122
}
117123

0 commit comments

Comments
 (0)