2020-08-06 20:58:47 +03:00
|
|
|
package cli
|
|
|
|
|
2022-12-18 09:07:38 +03:00
|
|
|
// cli flags.
|
2020-08-06 20:58:47 +03:00
|
|
|
const (
|
|
|
|
flagActiveSrc = "src"
|
|
|
|
flagActiveSrcUsage = "Override the active source for this query"
|
|
|
|
|
|
|
|
flagCSV = "csv"
|
|
|
|
flagCSVShort = "c"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagCSVUsage = "Output CSV"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagDriver = "driver"
|
|
|
|
flagDriverShort = "d"
|
|
|
|
flagDriverUsage = "Explicitly specify the data source driver to use"
|
|
|
|
|
|
|
|
flagHTML = "html"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagHTMLUsage = "Output HTML table"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagHeader = "header"
|
|
|
|
flagHeaderShort = "h"
|
2020-08-09 16:46:46 +03:00
|
|
|
flagHeaderUsage = "Print header row in output (default true)"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagHandle = "handle"
|
|
|
|
flagHandleShort = "h"
|
|
|
|
flagHandleUsage = "Handle for the source"
|
|
|
|
|
|
|
|
flagHelp = "help"
|
|
|
|
|
|
|
|
flagInsert = "insert"
|
2021-01-04 05:56:59 +03:00
|
|
|
flagInsertUsage = "Insert query results into @HANDLE.TABLE. If not existing, TABLE will be created."
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagJSON = "json"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagJSONUsage = "Output JSON"
|
2020-08-06 20:58:47 +03:00
|
|
|
flagJSONShort = "j"
|
|
|
|
flagJSONA = "jsona"
|
|
|
|
flagJSONAShort = "A"
|
2021-01-04 03:40:32 +03:00
|
|
|
flagJSONAUsage = "Output LF-delimited JSON arrays"
|
2020-08-06 20:58:47 +03:00
|
|
|
flagJSONL = "jsonl"
|
|
|
|
flagJSONLShort = "l"
|
2021-01-04 03:40:32 +03:00
|
|
|
flagJSONLUsage = "Output LF-delimited JSON objects"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagMarkdown = "markdown"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagMarkdownUsage = "Output Markdown"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
2023-03-19 09:18:54 +03:00
|
|
|
flagAddActive = "active"
|
|
|
|
flagAddActiveShort = "a"
|
|
|
|
flagAddActiveUsage = "Make this the active source"
|
|
|
|
|
2020-08-06 20:58:47 +03:00
|
|
|
flagMonochrome = "monochrome"
|
|
|
|
flagMonochromeShort = "M"
|
|
|
|
flagMonochromeUsage = "Don't colorize output"
|
|
|
|
|
|
|
|
flagOutput = "output"
|
|
|
|
flagOutputShort = "o"
|
|
|
|
flagOutputUsage = "Write output to <file> instead of stdout"
|
|
|
|
|
2022-12-25 07:04:18 +03:00
|
|
|
flagPasswordPrompt = "password"
|
|
|
|
flagPasswordPromptShort = "p"
|
|
|
|
flagPasswordPromptUsage = "Read password from stdin or prompt"
|
|
|
|
|
2020-08-06 20:58:47 +03:00
|
|
|
flagPretty = "pretty"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagPrettyUsage = "Pretty-print output"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagQueryDriverUsage = "Explicitly specify the data source driver to use when piping input"
|
|
|
|
flagQuerySrcOptionsUsage = "Driver-dependent data source options when piping input"
|
|
|
|
|
|
|
|
flagRaw = "raw"
|
|
|
|
flagRawShort = "r"
|
|
|
|
flagRawUsage = "Output each record field in raw format without any encoding or delimiter"
|
|
|
|
|
2023-03-15 10:43:48 +03:00
|
|
|
flagSQLExec = "exec"
|
2020-08-06 20:58:47 +03:00
|
|
|
flagSQLExecUsage = "Execute the SQL as a statement (as opposed to query)"
|
|
|
|
|
|
|
|
flagSQLQuery = "query"
|
|
|
|
flagSQLQueryUsage = "Execute the SQL as a query (as opposed to statement)"
|
|
|
|
|
|
|
|
flagSrcOptions = "opts"
|
|
|
|
flagSrcOptionsUsage = "Driver-dependent data source options"
|
|
|
|
|
|
|
|
flagTSV = "tsv"
|
|
|
|
flagTSVShort = "T"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagTSVUsage = "Output TSV"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagTable = "table"
|
|
|
|
flagTableShort = "t"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagTableUsage = "Output text table"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagTblData = "data"
|
2023-03-19 07:58:00 +03:00
|
|
|
flagTblDataUsage = "Copy table data"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
2021-02-27 17:44:08 +03:00
|
|
|
flagPingTimeout = "timeout"
|
|
|
|
flagPingTimeoutUsage = "Max time to wait for ping"
|
|
|
|
|
|
|
|
flagPingAll = "all"
|
|
|
|
flagPingAllShort = "a"
|
|
|
|
flagPingAllUsage = "Ping all sources"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagVerbose = "verbose"
|
|
|
|
flagVerboseShort = "v"
|
2022-12-17 06:46:37 +03:00
|
|
|
flagVerboseUsage = "Print verbose output, if applicable"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagVersion = "version"
|
|
|
|
flagVersionUsage = "Print sq version"
|
|
|
|
|
|
|
|
flagXLSX = "xlsx"
|
|
|
|
flagXLSXShort = "x"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagXLSXUsage = "Output Excel XLSX"
|
2020-08-06 20:58:47 +03:00
|
|
|
|
|
|
|
flagXML = "xml"
|
|
|
|
flagXMLShort = "X"
|
2020-10-20 18:05:43 +03:00
|
|
|
flagXMLUsage = "Output XML"
|
2022-12-25 07:04:18 +03:00
|
|
|
|
|
|
|
flagSkipVerify = "skip-verify"
|
|
|
|
flagSkipVerifyUsage = "Don't ping source before adding it"
|
2020-08-06 20:58:47 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
msgInvalidArgs = "invalid args"
|
|
|
|
msgNoActiveSrc = "no active data source"
|
|
|
|
msgEmptyQueryString = "query string is empty"
|
|
|
|
msgSrcNoData = "source has no data"
|
|
|
|
msgSrcEmptyTableName = "source has empty table name"
|
|
|
|
|
|
|
|
envarLogPath = "SQ_LOGFILE"
|
|
|
|
envarLogTruncate = "SQ_LOGFILE_TRUNCATE"
|
|
|
|
envarConfigDir = "SQ_CONFIGDIR"
|
|
|
|
)
|