bnash
Version:
A command-line editor for bash or compatible shells, aiming to provide great UX and productivity
260 lines (244 loc) • 12.1 kB
JavaScript
/*
List of subcommands for common programs such as git, docker, etc.
These lists are used by the command completion plugin, which activates
when the user types "tab".
*/
//------------------------------ git ------------------------------
let git = `add##Add file contents to the index.
#Apply a series of patches from a mailbox.
#Annotate file lines with commit information.
#Import an Arch repository into Git.
#Create an archive of files from a named tree.
#Use binary search to find the commit that introduced a bug.
#Show what revision and author last modified each line of a file.
#List, create, or delete branches.
#Move objects and refs by archive.
#Switch branches or restore working tree files.
#Find commits yet to be applied to upstream.
#Apply the changes introduced by some existing commits.
#Graphical alternative to commit.
#Remove untracked files from the working tree.
#Clone a repository into a new directory.
#Record changes to the repository.
#Get and set repository or global options.
#Count unpacked number of objects and their disk consumption.
#Export a single commit to a CVS checkout.
#Salvage your data out of another SCM people love to hate.
#A CVS server emulator for Git.
#Give an object a human readable name based on an available ref.
#Show changes between commits, commit and working tree, etc.
#Show changes using common diff tools.
#Git data exporter.
#Backend for fast Git data importers.
#Download objects and refs from another repository.
#Rewrite branches.
#Prepare patches for e-mail submission.
#Verifies the connectivity and validity of the objects in the database.
#Cleanup unnecessary files and optimize the local repository.
#Extract commit ID from an archive created using archive.
#The Git repository browser.
#Git web interface (web frontend to Git repositories).
#Print lines matching a pattern.
#A portable graphical interface to Git.
#Display help information about Git.
#Send a collection of patches from stdin to an IMAP folder.
#Create an empty Git repository or reinitialize an existing one.
#Instantly browse your working repository in gitweb.
#Show commit logs.
#Show three-way merge without touching index.
#Join two or more development histories together.
#Run merge conflict resolution tools to resolve merge conflicts.
#Move or rename a file, a directory, or a symlink.
#Add or inspect object notes.
#Import from and submit to Perforce repositories.
#Pack heads and tags for efficient repository access.
#Prune all unreachable objects from the object database.
#Fetch from and integrate with another repository or a local branch.
#Update remote refs along with associated objects.
#Applies a quilt patchset onto the current branch.
#Reapply commits on top of another base tip.
#Manage reflog information.
#Manage set of tracked repositories.
#Pack unpacked objects in a repository.
#Create, list, delete refs to replace objects.
#Generates a summary of pending changes.
#Reuse recorded resolution of conflicted merges.
#Reset current HEAD to the specified state.
#Pick out and massage parameters.
#Revert some existing commits.
#Remove files from the working tree and from the index.
#Send a collection of patches as emails.
#Summarize git log output.
#Show branches and their commits.
#Show various types of objects.
#Stash the changes in a dirty working directory away.
#Show the working tree status.
#Initialize, update or inspect submodules.
#Bidirectional operation between a Subversion repository and Git.
#Create, list, delete or verify a tag object signed with GPG.
#Check the GPG signature of commits.
#Check the GPG signature of tags.
#Show logs with difference each commit introduces.
#Manage multiple working trees.`.split('\n')
//------------------------------ docker ------------------------------
let docker = `builder##Manage builds
#Manage Docker configs
#Manage containers
#Manage contexts
#Manage images
#Manage networks
#Manage Swarm nodes
#Manage plugins
#Manage Docker secrets
#Manage services
#Manage Docker stacks
#Manage Swarm
#Manage Docker
#Manage trust on Docker images
#Manage volumes
#Attach local standard input, output, and error streams to a running container
#Build an image from a Dockerfile
#Create a new image from a container's changes
#Copy files/folders between a container and the local filesystem
#Create a new container
#Inspect changes to files or directories on a container's filesystem
#Get real time events from the server
#Run a command in a running container
#Export a container's filesystem as a tar archive
#Show the history of an image
#List images
#Import the contents from a tarball to create a filesystem image
#Display system-wide information
#Return low-level information on Docker objects
#Kill one or more running containers
#Load an image from a tar archive or STDIN
#Log in to a Docker registry
#Log out from a Docker registry
#Fetch the logs of a container
#Pause all processes within one or more containers
#List port mappings or a specific mapping for the container
#List containers
#Pull an image or a repository from a registry
#Push an image or a repository to a registry
#Rename a container
#Restart one or more containers
#Remove one or more containers
#Remove one or more images
#Run a command in a new container
#Save one or more images to a tar archive (streamed to STDOUT by default)
#Search the Docker Hub for images
#Start one or more stopped containers
#Display a live stream of container(s) resource usage statistics
#Stop one or more running containers
#Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
#Display the running processes of a container
#Unpause all processes within one or more containers
#Update configuration of one or more containers
#Show the Docker version information
#Block until one or more containers stop, then print their exit codes`
.split('\n')
let dockerContainer = `attach##Attach local standard input, output, and error streams to a running container
#Create a new image from a container's changes
#Copy files/folders between a container and the local filesystem
#Create a new container
#Inspect changes to files or directories on a container's filesystem
#Run a command in a running container
#Export a container's filesystem as a tar archive
#Display detailed information on one or more containers
#Kill one or more running containers
#Fetch the logs of a container
#List containers
#Pause all processes within one or more containers
#List port mappings or a specific mapping for the container
#Remove all stopped containers
#Rename a container
#Restart one or more containers
#Remove one or more containers
#Run a command in a new container
#Start one or more stopped containers
#Display a live stream of container(s) resource usage statistics
#Stop one or more running containers
#Display the running processes of a container
#Unpause all processes within one or more containers
#Update configuration of one or more containers
#Block until one or more containers stop, then print their exit codes`
.split('\n')
let dockerImage = `build##Build an image from a Dockerfile
#Show the history of an image
#Import the contents from a tarball to create a filesystem image
#Display detailed information on one or more images
#Load an image from a tar archive or STDIN
#List images
#Remove unused images
#Pull an image or a repository from a registry
#Push an image or a repository to a registry
#Remove one or more images
#Save one or more images to a tar archive (streamed to STDOUT by default)
#Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE`.split('\n')
let dockerNetwork = `connect##Connect a container to a network
#Create a network
#Disconnect a container from a network
#Display detailed information on one or more networks
#List networks
#Remove all unused networks
#Remove one or more networks`.split('\n')
//------------------------------ kubectl ------------------------------
let kubectl = `create##Create a resource from a file or from stdin.
#Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service
#Run a particular image on the cluster
#Set specific features on objects
#Documentation of resources
#Display one or many resources
#Edit a resource on the server
#Delete resources by filenames, stdin, resources and names, or by resources and label selector
#Manage the rollout of a resource
#Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job
#Auto-scale a Deployment, ReplicaSet, or ReplicationController
#Modify certificate resources.
#Display cluster info
#Display Resource (CPU/Memory/Storage) usage.
#Mark node as unschedulable
#Mark node as schedulable
#Drain node in preparation for maintenance
#Update the taints on one or more nodes
#Show details of a specific resource or group of resources
#Print the logs for a container in a pod
#Attach to a running container
#Execute a command in a container
#Forward one or more local ports to a pod
#Run a proxy to the Kubernetes API server
#Copy files and directories to and from containers.
#Inspect authorization
#Diff live version against would-be applied version
#Apply a configuration to a resource by filename or stdin
#Update field(s) of a resource using strategic merge patch
#Replace a resource by filename or stdin
#Experimental: Wait for a specific condition on one or many resources.
#Convert config files between different API versions
#Build a kustomization target from a directory or a remote url.
#Update the labels on a resource
#Update the annotations on a resource
#Output shell completion code for the specified shell (bash or zsh)
#Print the supported API resources on the server
#Print the supported API versions on the server, in the form of "group/version"
#Modify kubeconfig files
#Provides utilities for interacting with plugins.
#Print the client and server version information`.split('\n')
//------------------------------ npm ------------------------------
let npm = ('access adduser audit bin bugs c cache ci cit clean-install ' +
'clean-install-test completion config create ddp dedupe deprecate ' +
'dist-tag docs doctor edit explore fund get help help-search hook i init ' +
'install install-ci-test install-test it link list ln login logout ls ' +
'org outdated owner pack ping prefix profile prune publish rb rebuild ' +
'repo restart root run run-script s se search set shrinkwrap star ' +
'stars start stop t team test token tst un uninstall unpublish unstar ' +
'up update v version view whoami').split(' ')
module.exports = {
git,
docker,
'docker container': dockerContainer,
'docker image': dockerImage,
'docker network': dockerNetwork,
kubectl,
npm
}