Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ctclient: Use Cobra library for command-line tools (#901)
This change refactors the ctclient tool to use the widely adopted Cobra library for handling CLI flags and subcommands. Before: $ ./ctclient -h Usage of ./ctclient: -align_getentries Enable get-entries request alignment (default true) -alsologtostderr log to standard error as well as files -cert_chain string Name of file containing certificate chain as concatenated PEM files -chain Display entire certificate chain -first int First entry to get (default -1) -last int Last entry to get (default -1) -leaf_hash string Leaf hash to retrieve (as hex string or base64) -log_backtrace_at value when logging hits line file:N, emit a stack trace -log_dir string If non-empty, write log files in this directory -log_list string Location of master log list (URL or filename) (default "https://www.gstatic.com/ct/log_list/all_logs_list.json") -log_mmd duration Log's maximum merge delay (default 24h0m0s) -log_name string Name of log to retrieve information from --log_list for -log_uri string CT log base URI (default "https://ct.googleapis.com/rocketeer") -logtostderr log to standard error instead of files -prev_hash string Previous tree hash to check against (as hex string or base64) -prev_size uint Previous tree size to get consistency against -pub_key string Name of file containing log's public key -size uint Tree size to query at -skip_https_verify Skip verification of HTTPS transport connection -stderrthreshold value logs at or above this threshold go to stderr -text Display certificates as text (default true) -timestamp int Timestamp to use for inclusion checking -tree_hash string Tree hash to check against (as hex string or base64) -v value log level for V logs -vmodule value comma-separated list of pattern=N settings for file-filtered logging After: $ ./ctclient --help A command line client for Certificate Transparency logs Usage: ctclient [command] Available Commands: bisect Find a log entry by timestamp completion Generate the autocompletion script for the specified shell get-consistency-proof Fetch and verify a consistency proof between two tree states get-entries Fetch a range of entries in the log get-inclusion-proof Fetch and verify the inclusion proof for an entry get-roots Fetch the root certificates accepted by the log get-sth Fetch the latest STH of the log help Help about any command upload Submit a certificate (pre-)chain to the log Flags: ... Use "ctclient [command] --help" for more information about a command. $ ./ctclient getentries --help Fetch a range of entries in the log Usage: ctclient get-entries {--log_uri uri | --log_name name [--log_list {file|uri}]} [--pub_key file] --first=idx [--last=idx] [flags] Aliases: get-entries, getentries, entries Flags: --chain Display entire certificate chain --first int First entry to get (default -1) -h, --help help for get-entries --last int Last entry to get (default -1) --text Display certificates as text (default true) Global Flags: --alsologtostderr log to standard error as well as files --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) --log_dir string If non-empty, write log files in this directory --log_list string Location of master log list (URL or filename) (default "https://www.gstatic.com/ct/log_list/all_logs_list.json") --log_name string Name of log to retrieve information from --log_list for --log_uri string CT log base URI (default "https://ct.googleapis.com/rocketeer") --logtostderr log to standard error instead of files --pub_key string Name of file containing log's public key --skip_https_verify Skip verification of HTTPS transport connection --stderrthreshold severity logs at or above this threshold go to stderr (default 2) -v, --v Level log level for V logs --vmodule moduleSpec comma-separated list of pattern=N settings for file-filter
- Loading branch information