Skip to content

Commit

Permalink
improved docs and minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
guumaster committed Apr 13, 2020
1 parent d954e23 commit 97c0e23
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions cmd/add_domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

// addDomainsCmd represents the fromFile command
var addDomainsCmd = &cobra.Command{
Use: "domains [domains] [flag]",
Aliases: []string{"domain"},
Use: "domains [profile] [domains] [flags]",
Aliases: []string{"domain [profile] [domains] [flags]"},
Short: "Add content in your hosts file.",
Long: `
Set content in your hosts file.
Expand Down
10 changes: 4 additions & 6 deletions cmd/add_replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import (

// addCmd represents the fromFile command
var addCmd = &cobra.Command{
Use: "add-to [profile] [flags]",
Aliases: []string{"add"},
Short: "Add content to a profile in your hosts file.",
Use: "add [profiles] [flags]",
Short: "Add content to a profile in your hosts file.",
Long: `
Reads from a file and set content to a profile in your hosts file.
If the profile already exists it will be added to it.`,
Expand All @@ -26,9 +25,8 @@ If the profile already exists it will be added to it.`,

// replaceCmd represents the setFromFile command
var replaceCmd = &cobra.Command{
Use: "replace [profile] [domains] [flags]",
Aliases: []string{"set"},
Short: "Replace content to a profile in your hosts file.",
Use: "replace [profile] [flags]",
Short: "Replace content to a profile in your hosts file.",
Long: `
Reads from a file and set content to a profile in your hosts file.
If the profile already exists it will be overwritten.
Expand Down
2 changes: 1 addition & 1 deletion cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// backupCmd represents the backup command
var backupCmd = &cobra.Command{
Use: "backup",
Use: "backup [flags]",
Short: "Creates a backup copy of your hosts file",
Long: `
Creates a backup copy of your hosts file with the date in .YYYYMMDD
Expand Down
2 changes: 1 addition & 1 deletion cmd/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// disableCmd represents the disable command
var disableCmd = &cobra.Command{
Use: "disable",
Use: "disable [profiles] [flags]",
Short: "Disable a profile from your hosts file.",
Long: `
Disable a profile from your hosts file without removing it.
Expand Down
2 changes: 1 addition & 1 deletion cmd/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// enableCmd represents the enable command
var enableCmd = &cobra.Command{
Use: "enable",
Use: "enable [profiles] [flags]",
Short: "Enable a profile on your hosts file.",
Long: `
Enables an existing profile.
Expand Down
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// listCmd represents the list command
var listCmd = &cobra.Command{
Use: "list",
Use: "list [profiles] [flags]",
Short: "Shows a detailed list of profiles on your hosts file.",
Long: `
Shows a detailed list of profiles on your hosts file with name, ip and host name.
Expand Down
4 changes: 2 additions & 2 deletions cmd/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

// removeCmd represents the remove command
var removeCmd = &cobra.Command{
Use: "remove",
Aliases: []string{"rm"},
Use: "remove [profiles] [flags]",
Aliases: []string{"rm [profiles] [flags]"},
Short: "Remove a profile from your hosts file.",
Long: `
Completely remove a profile content from your hosts file.
Expand Down
4 changes: 2 additions & 2 deletions cmd/remove_domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

// removeDomainsCmd represents the remove command
var removeDomainsCmd = &cobra.Command{
Use: "domains",
Aliases: []string{"domain"},
Use: "domains [profile] [domains] [flags]",
Aliases: []string{"domain [profile] [domains] [flags]"},
Short: "Remove domains from your hosts file.",
Long: `
Completely remove domains from your hosts file.
Expand Down
2 changes: 1 addition & 1 deletion cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// restoreCmd represents the restore command
var restoreCmd = &cobra.Command{
Use: "restore",
Use: "restore [flags]",
Short: "Restore hosts file content from a backup file.",
Long: `
Reads from a file and replace the content of your hosts file.
Expand Down
2 changes: 1 addition & 1 deletion cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// statusCmd represents the list command
var statusCmd = &cobra.Command{
Use: "status",
Use: "status [profiles] [flags]",
Short: "Shows a list of profile names and statuses on your hosts file.",
Long: `
Shows a list of unique profile names on your hosts file with its status.
Expand Down
2 changes: 1 addition & 1 deletion cmd/sync_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// syncDockerCmd represents the sync docker command
var syncDockerCmd = &cobra.Command{
Use: "docker",
Use: "docker [profile] [flags]",
Short: "Sync your Docker containers IPs with a profile.",
Long: `
Reads from Docker the list of containers and add names and IPs to a profile in your hosts file.
Expand Down
5 changes: 3 additions & 2 deletions cmd/sync_docker_compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// syncDockerComposeCmd represents the sync docker command
var syncDockerComposeCmd = &cobra.Command{
Use: "docker-compose",
Use: "docker-compose [profile] [flags]",
Short: "Sync your docker-compose containers IPs with a profile.",
Long: `
Reads from a docker-compose.yml file the list of containers and add names and IPs to a profile in your hosts file.
Expand Down Expand Up @@ -56,7 +56,8 @@ Reads from a docker-compose.yml file the list of containers and add names and I

if profile == "" {
profile = compose.ProjectName
_ = cmd.Flags().Set("profile", profile)
profiles = append(profiles, profile)
cmd.SetArgs(profiles)
}

if domain == "" {
Expand Down

0 comments on commit 97c0e23

Please sign in to comment.