Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13895056
options.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
796 B
Subscribers
None
options.go
View Options
package
main
import
(
"github.com/cloudfoundry/jibber_jabber"
cli
"gopkg.in/urfave/cli.v1"
)
func
userAgent
(
c
*
cli
.
Context
)
string
{
ua
:=
c
.
String
(
"user-agent"
)
if
ua
==
""
{
return
defaultUserAgent
}
return
ua
+
" ("
+
defaultUserAgent
+
")"
}
func
isTor
(
c
*
cli
.
Context
)
bool
{
return
c
.
Bool
(
"tor"
)
||
c
.
Bool
(
"t"
)
}
func
language
(
c
*
cli
.
Context
,
auto
bool
)
string
{
if
l
:=
c
.
String
(
"lang"
);
l
!=
""
{
return
l
}
if
!
auto
{
return
""
}
// Automatically detect language
l
,
err
:=
jibber_jabber
.
DetectLanguage
()
if
err
!=
nil
{
Info
(
c
,
"Language detection failed: %s"
,
err
)
return
""
}
return
l
}
func
collection
(
c
*
cli
.
Context
)
string
{
if
coll
:=
c
.
String
(
"c"
);
coll
!=
""
{
return
coll
}
if
coll
:=
c
.
String
(
"b"
);
coll
!=
""
{
return
coll
}
return
""
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 13, 4:32 AM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3649389
Attached To
rWCLI writeas-cli
Event Timeline
Log In to Comment