Package: scarab
Overviewscarab is a CLI tool to automate some of the Bugzilla-related workflows in the FreeBSD project.Installation# Install python3 and pip 
sudo pkg install python3 py36-pip

# Install latest release of scarab
pip-3.6 install --user scarab
# .. or current WIP
git clone https://github.com/gonzoua/scarab.git
cd scarab
pip-3.6 install --user -e .

# Add ~/.local/bin to PATH
# for bash:
export PATH=$PATH:~/.local/bin
# for tcsh/csh:
setenv PATH $PATH\:$HOME/.local/bin

# test setup
scarab productsSettingsscarab config file has a generic section-based INI format. A section starts with [sectionname]  and consists of key/value pairs separated by "=". Value is the part of the line after "=" with leading and trailing spaces removed.  If there are spaces in the middle of the string, they're treated as a part of the value.[default] sectionurlBase URL  for Bugzilla setup. By default, it's FreeBSD's Bugzilla instancehttps://bugs.freebsd.org/bugzilla/api_keyAPI key for the operations. Normally commands that do not modify Bugzilla's state likefetch,fetchall,filedo not require it, unless you're trying to access PRs with restricted access. To generate new API key login to your Bugzilla instance, click on "Preferences" link then select "API keys" tab, check "Generate a new API key ..." checkbox, provide an optional description and click "Submit Changes"[template:NNN] sectionsTemplates are sets of fields that you can use when submitting new PRs instead of specifying them individually as command-line arguments. Valid keys for this kind of section are:product,component,version,platform,severity. Possible values depend on the actual Bugzilla instance configuration. Some of them can be inspected usingproductscommand. The part of the section name after the colon is used as an argument to-tswitch of thesubmitcommand as a shorthand for multiple switches. For more examples of template usage seescarabrc.Commandsaddaflagaddaflag [-h] attachment_id name [requestee]Add new flag named name to attachment attachment_id. If flag can be requested from specific user they can be specified by an optional requestee argument.addflagaddflag [-h] bug_id name [requestee]Add new flag named name to bug bug_id. If flag can be requested from specific user they can be specified by an optional requestee argument.aflagsaflags [-h] attachment_idDisplay flags for bug bug_id.attachattach [-h] [-s SUMMARY] [-c COMMENT | -F COMMENT_FILE] [-t CONTENT_TYPE] attachment prAttach file specified by the pathattachmentto the bug with idpr. If no summary provided the file name is used as a summary. If neither-cnor-Fis specified tool will invoke editor so a user can enter the comment text. File content type is detecting automatically using libmagic and can be overridden by-tcommand-line switch.fetchfetch [-h] [-o OUTPUT] attachment_idDownload attachment with the idattachment_idto the file specified by-ocommand-line switch or to the file in the current directory with the same name as an attachment.fetchallfetchall [-h] bug_idDownload all non-obsolete attachments of the bug with idbug_idto the current directory.filesfiles [-h] [-a] [-s] bug_idShow list of the files attached to the bug with idbug_id. Unless-ais specified only non-obsolete attachments are displayed. When-sis used, the summary of the attachment is displayed instead of the file name.infoinfo [-h] bug_idDisplay information for bug bug_id including bug descriptionflagsflags [-h] bug_idDisplay flags for bug bug_id.productsproducts [-h]Display list of products, their components and versionsrmaflagsrmaflags [-h] attachment_id name [name ...]Remove one or more flags from attachment attachment_id. Name can be either flag name or numeric flag id, if there are more than one flag with the same name.rmflagsrmflags [-h] bug_id name [name ...]Remove one or more flags from bug bug_id. Name can be either flag name or numeric flag id, if there are more than one flag with the same name.setaflagsetaflag [-h] attachment_id name {+,-}Change attachment's flag value to either + or -. name can be either flag name or number flag id.setflagsetflag [-h] bug_id name {+,-}Change bug's flag value to either + or -. name can be either flag name or number flag id.submitsubmit [-h] [-t TEMPLATES] [-p PRODUCT] [-m COMPONENT] [-v VERSION] [-c COMMENT | -F COMMENT_FILE] -s SUMMARY [-C CC] [-P PLATFORM] [-S SEVERITY]Submit new bug with the summary specified by-scommand-line switch. Mandatory fieldsproduct,component,versionshould be specified either by command-line switches or as values in templates sections. If multiple templates are specified in one invocation, they are merged with fields each following template overriding values present in the previous ones. Values for the fields provided as a command-line switch override the values in the templates.updateupdate [-h] [-s STATUS] [-r RESOLUTION] [-a ASSIGNED_TO] [-C ADD_CC] [-X REMOVE_CC] [-c COMMENT | -F COMMENT_FILE] bug_idUpdate fields in existing PR. If neither-cnor-Fspecified no comment is posted with the change.-Cand-Xcan be specified multiple times to add/remove more than one user.DevelopmentTo run the scarab command using checked out version of the repo usepython3 -m scarab.cli ...command