cli

command module
v0.0.0-...-e1fd696 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

README

MediaWiki CLI

This project contains a command-line interface for interacting with MediaWiki development environments.

Take a look at the user facing docs https://www.mediawiki.org/wiki/Cli

Docker

There is currently 1 subcommand:

  • docker allows interacting with a new version of the MediaWiki-docker-dev development environment. (See mw help docker)

Contributing

Clone this repository to your $GOPATH (probably ~/go), so it would be at ~/go/src/gerrit.wikimedia.org/r/mediawiki/tools/cli.

Within the ~/go/src/gerrit.wikimedia.org/r/mediawiki/tools/cli/cmd directory:

  • run make to download dependencies and build an initial binary

Execute the tool without building from any directory by running the ./dev.sh script.

Packages & Directories
  • cmd: Contains the Cobra commands and deals with all CLI user interaction.
  • internal/cmd: General Cobra command abstractions that may be useful in multiple places.
  • internal/docker: Logic interacting with the mediawiki-docker dev environment.
  • internal/env: Logic interacting with a .env file.
  • internal/exec: Wrapper for the main exec package, providing easy verbosity etc.
  • internal/mediawiki: Logic interacting with a MediaWiki installation directory on disk.
  • internal/mwdd: Logic for the MediaWiki-docker-dev development environment.
  • static: Files that end up being built into the binary.
cmd names

No naming structured is enforced in CI but a convention exists that should be followed.

  • root.go exists as the overall CLI script.
  • Top level commands will have their own file in the cmd directory, named after the command. Example: docker.go.
  • Simple sub commands will be defined in those files as vars prefixed with the parent command. For example dockerStart.
  • Complex sub commands will be split out into their own file. For example docker_env.go.
  • This is a recursive solution.
Using a binary

Make a binary by running make

Execute the binary from any directory with ~/go/src/gerrit.wikimedia.org/r/mediawiki/tools/cli/bin/cli

Support

Documentation

Overview

Copyright © 2020 Kosta Harlan <kosta@kostaharlan.net>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Directories

Path Synopsis
Package cmd is used for command line.
Package cmd is used for command line.
internal
cmd
Package cmd is used for building command line commands
Package cmd is used for building command line commands
config
Package config for interacting with the cli config
Package config for interacting with the cli config
docker
Package docker is used to interact with docker development environment services
Package docker is used to interact with docker development environment services
env
Package env for interacting with a .env file
Package env for interacting with a .env file
exec
Package exec is used for executing commands
Package exec is used for executing commands
mediawiki
Package mediawiki is used to interact with MediaWiki
Package mediawiki is used to interact with MediaWiki
mwdd
Package mwdd is used to interact a mwdd v2 setup
Package mwdd is used to interact a mwdd v2 setup
mwdd/files
Package files for interacting packaged files and their counterparts on disk for a project directory
Package files for interacting packaged files and their counterparts on disk for a project directory
updater
Package updater is used to update the cli
Package updater is used to update the cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL