Skip to content

Commit

Permalink
update cmd examples structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed May 9, 2020
1 parent de41426 commit 883a030
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cmd/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
var cpCmd = &cobra.Command{
Use: "cp",
Short: "Copy files between a VM and the local filesystem",
Long: `Copy files between a VM and the local filesystem
Examples:
Long: "Copy files between a VM and the local filesystem",
Example: `
Copy file.txt from host to user's home directory inside the vm
$ vermin cp vm_01 -l file.txt
Expand Down
4 changes: 2 additions & 2 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
var createCmd = &cobra.Command{
Use: "create",
Short: "Create a new VM",
Long: `Create a new VM
Long: "Create a new VM",
Example: `
To list all available images:
$ vermin images
Expand Down
5 changes: 2 additions & 3 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import (
var execCmd = &cobra.Command{
Use: "exec",
Short: "Run a command in a running VM",
Long: `Run a command in a running VM
Examples:
Long: `Run a command in a running VM`,
Example: `
Execute remote command:
$ vermin exec vm_09 cat /etc/passwd
`,
Expand Down
5 changes: 3 additions & 2 deletions cmd/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ var imagesCmd = &cobra.Command{
Use: "images",
Short: "List remote and cached images",
Long: `List remote and cached images
Images are cached after the first time it is downloaded. Cached images are marked as (cached).
The image comes in the format <os>/<version>, for example: ubuntu/bionic and centos/8
`,
Example: `
Use the image in creating a VM:
$ vermin create <image>
`,
Expand Down
4 changes: 2 additions & 2 deletions cmd/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var ipCmd = &cobra.Command{
Long: `Show IP address for a running VM
Sometimes, the IP information being stale, so you might need use the --purge|-p flag
Examples:
`,
Example: `
$ vermin ip vm_11
To purge the IP cache:
$ vermin ip vm_05 -p
Expand Down
7 changes: 4 additions & 3 deletions cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ var mountCmd = &cobra.Command{
Short: "Mount host path inside the VM",
Long: `Mount host path to /vermin directory inside the VM
To mount the ~/Downloads directory to /vermin inside the VM:
$ vermin mount vm_01 ~/Downloads
Note:
1. You can mount as many times as you want, and each time old mounts are removed.
2. Mounts are transient.
`,
Example: `
To mount the ~/Downloads directory to /vermin inside the VM:
$ vermin mount vm_01 ~/Downloads
`,
Run: func(cmd *cobra.Command, args []string) {
vmName := args[0]
Expand Down
5 changes: 2 additions & 3 deletions cmd/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ var portCmd = &cobra.Command{
Long: `Forward port(s) from a VM to host
Usage: vermin port <vm> <vm port>[:local port] [<vm port>[:local port]]
Examples:
`,
Example: `
Forward vm port 4040 to local port 4040:
$ vermin port vm_01 4040
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
var rootCmd = &cobra.Command{
Use: "vermin",
Short: "Create, control and connect to VirtualBox VM instances.",
Long: `Create, control and connect to VirtualBox VM instances
Long: `Create, control and connect to VirtualBox VM instances`,
Example: `
You can start using vermin by creating a vm from an image.
To list all images available:
$ vermin images
Expand Down
5 changes: 2 additions & 3 deletions cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import (
var sshCmd = &cobra.Command{
Use: "ssh",
Short: "ssh into a running VM",
Long: `ssh into a running VM
Examples:
Long: `ssh into a running VM`,
Example: `
Open a terminal:
$ vermin ssh vm_02
`,
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit 883a030

Please sign in to comment.