diff --git a/docs/content/cli/_index.md b/docs/content/cli/_index.md index df29c2e..48f3d57 100644 --- a/docs/content/cli/_index.md +++ b/docs/content/cli/_index.md @@ -167,3 +167,39 @@ Global Flags: Use "backy list [command] --help" for more information about a command. ``` +## list cmds + +``` +List commands defined in config file + +Usage: + backy list cmds [cmd1 cmd2 cmd3...] [flags] + +Flags: + -h, --help help for cmds + +Global Flags: + --cmdStdOut Pass to print command output to stdout + -f, --config string config file to read from + --log-file string log file to write to + --s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable. + -v, --verbose Sets verbose level +``` +## list lists + +``` +List lists defined in config file + +Usage: + backy list lists [list1 list2 ...] [flags] + +Flags: + -h, --help help for lists + +Global Flags: + --cmdStdOut Pass to print command output to stdout + -f, --config string config file to read from + --log-file string log file to write to + --s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable. + -v, --verbose Sets verbose level +``` diff --git a/docs/content/cli/exec.md b/docs/content/cli/exec.md index 7767380..c29c359 100644 --- a/docs/content/cli/exec.md +++ b/docs/content/cli/exec.md @@ -15,5 +15,5 @@ The `exec` subcommand can do some things that the configuration file can't do ye The commands have to be defined in the config file. The hosts need to at least be in the ssh_config(5) file. ```sh -backy exec host [--commands command1 -commands command2 ... | -c command1 -c command2 ...] [--hosts host1 --hosts hosts2 ... | -m host1 -c host2 ...] [flags] +backy exec host [--commands=command1 -commands=command2 ... | -c command1 -c command2 ...] [--hosts=host1 --hosts=hosts2 ... | -m host1 -c host2 ...] [flags] ``` diff --git a/docs/content/config/remote-resources.md b/docs/content/config/remote-resources.md index 036d972..54bd918 100644 --- a/docs/content/config/remote-resources.md +++ b/docs/content/config/remote-resources.md @@ -14,4 +14,4 @@ If using S3, you should use the s3 protocol URI: `s3://bucketName/key/path`. You ## Scripts -Scripts will be coming later. \ No newline at end of file +Remote script support is currently limited to http/https endpoints. \ No newline at end of file diff --git a/getCommandHelp b/getCommandHelp index 324a9c1..a4111f1 100755 --- a/getCommandHelp +++ b/getCommandHelp @@ -63,5 +63,17 @@ echo "\`\`\`" >> _index.md eval "${BACKYCOMMAND} list -h >> _index.md" echo "\`\`\`" >> _index.md +echo "## list cmds" >> _index.md +echo "" >> _index.md +echo "\`\`\`" >> _index.md +eval "${BACKYCOMMAND} list cmds -h >> _index.md" +echo "\`\`\`" >> _index.md + +echo "## list lists" >> _index.md +echo "" >> _index.md +echo "\`\`\`" >> _index.md +eval "${BACKYCOMMAND} list lists -h >> _index.md" +echo "\`\`\`" >> _index.md + mv _index.md "$CLI_PAGE" \ No newline at end of file diff --git a/pkg/remotefetcher/s3.go b/pkg/remotefetcher/s3.go index 338eec2..04b43ee 100644 --- a/pkg/remotefetcher/s3.go +++ b/pkg/remotefetcher/s3.go @@ -49,6 +49,7 @@ func NewS3Fetcher(endpoint string, options ...FetcherOption) (*S3Fetcher, error) println(err.Error()) return nil, err } + // Initialize S3 client if not provided if cfg.S3Client == nil { s3Client, err = minio.New(s3Endpoint, &minio.Options{ @@ -128,7 +129,6 @@ func (s *S3Fetcher) Hash(data []byte) string { } func getS3Credentials(profile, host string, httpClient *http.Client) (*credentials.Credentials, error) { - // println(s3utils.GetRegionFromURL(*u)) homeDir, hdirErr := homedir.Dir() if hdirErr != nil { return nil, hdirErr