You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/document.go
+39Lines changed: 39 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,8 @@ var (
41
41
42
42
docStatusHistorybool
43
43
docStatusJQstring
44
+
45
+
docOpenNoBrowserbool
44
46
)
45
47
46
48
vardocumentCmd=&cobra.Command{
@@ -127,6 +129,17 @@ approval histories for all past versions.`,
127
129
RunE: runDocumentStatus,
128
130
}
129
131
132
+
vardocumentOpenCmd=&cobra.Command{
133
+
Use: "open <docid>",
134
+
Short: "Open a document in the default web browser",
135
+
Long: `Open the document view page in the default web browser.
136
+
137
+
The URL is built from the configured subdomain (no API request is made).
138
+
Pass --no-browser (or -n) to print the URL without launching the browser.`,
139
+
Args: cobra.ExactArgs(1),
140
+
RunE: runDocumentOpen,
141
+
}
142
+
130
143
vardocumentDownloadCmd=&cobra.Command{
131
144
Use: "download <docid>",
132
145
Short: "Download a document as PDF",
@@ -150,6 +163,7 @@ func init() {
150
163
documentCmd.AddCommand(documentDeleteCmd)
151
164
documentCmd.AddCommand(documentStatusCmd)
152
165
documentCmd.AddCommand(documentDownloadCmd)
166
+
documentCmd.AddCommand(documentOpenCmd)
153
167
154
168
f:=documentSearchCmd.Flags()
155
169
f.StringVar(&docSearchBody, "body", "", "search condition JSON: inline, file path, or - for stdin")
@@ -184,6 +198,9 @@ func init() {
184
198
185
199
dlf:=documentDownloadCmd.Flags()
186
200
dlf.StringVarP(&docDownloadOutput, "output", "o", "", "output path: FILE, DIR/, or - for stdout (default: server-provided filename in current directory)")
201
+
202
+
of:=documentOpenCmd.Flags()
203
+
of.BoolVarP(&docOpenNoBrowser, "no-browser", "n", false, "print the URL without launching the browser")
0 commit comments