From b7032a1e9e928996739e56e8950c29ee3308198a Mon Sep 17 00:00:00 2001 From: Andrejs Labunskis Date: Thu, 28 May 2020 17:25:07 +0300 Subject: [PATCH] CLI-8 Fix parameter naming + version bump + docs update --- README.md | 6 ++++++ cmd/file.go | 26 +++++++++++++------------- cmd/root.go | 2 +- docs/lokalise2.md | 4 ++-- docs/lokalise2_branch.md | 2 +- docs/lokalise2_comment.md | 2 +- docs/lokalise2_contributor.md | 2 +- docs/lokalise2_file.md | 2 +- docs/lokalise2_file_upload.md | 4 ++-- docs/lokalise2_key.md | 2 +- docs/lokalise2_language.md | 2 +- docs/lokalise2_order.md | 2 +- docs/lokalise2_payment-card.md | 2 +- docs/lokalise2_project.md | 2 +- docs/lokalise2_queued-process.md | 2 +- docs/lokalise2_screenshot.md | 2 +- docs/lokalise2_snapshot.md | 2 +- docs/lokalise2_task.md | 2 +- docs/lokalise2_team-user-group.md | 2 +- docs/lokalise2_team-user.md | 2 +- docs/lokalise2_team.md | 2 +- docs/lokalise2_translation-provider.md | 2 +- docs/lokalise2_translation-status.md | 2 +- docs/lokalise2_translation.md | 2 +- docs/lokalise2_webhook.md | 2 +- 25 files changed, 44 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 6c30020..095c67c 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,12 @@ If you are using project branching feature in Lokalise, simply add branch name s Optionally, you may rename included `config-example.yml` to `config.yml` and set various CLI tool parameters like token or timeouts. You can specify a config file location using `--config` parameter. ## Changes +**2.5.1 (May 28, 2020)** + +- Fix flag naming typo for file upload + - Changed `--pool` to `--poll` + - Changed `--pool-timeout` to `--poll` + **2.5.0 (May 28, 2020)** - Added queued process [commands](docs/lokalise2_queued-process.md) diff --git a/cmd/file.go b/cmd/file.go index bb6343f..8c110fc 100644 --- a/cmd/file.go +++ b/cmd/file.go @@ -21,7 +21,7 @@ import ( "github.com/spf13/cobra" ) -const poolingFrequency = 2 * time.Second +const pollingFrequency = 2 * time.Second var ( filterFilename string @@ -49,8 +49,8 @@ var ( uploadIncludePath bool - uploadPooling bool - uploadPoolingTimeout time.Duration + uploadPolling bool + uploadPollingTimeout time.Duration uploadFile string ) @@ -131,7 +131,7 @@ var fileUploadCmd = &cobra.Command{ return err } - if !uploadPooling { + if !uploadPolling { _ = printJson(resp) continue } @@ -142,10 +142,10 @@ var fileUploadCmd = &cobra.Command{ defer wg.Done() defer close(errs) - poolUntil := time.Now().Add(uploadPoolingTimeout) + pollUntil := time.Now().Add(uploadPollingTimeout) for { - if time.Now().After(poolUntil) { - errs <- errors.New("pooling time exceeded limit") + if time.Now().After(pollUntil) { + errs <- errors.New("polling time exceeded limit") break } @@ -162,13 +162,13 @@ var fileUploadCmd = &cobra.Command{ break } - time.Sleep(poolingFrequency) + time.Sleep(pollingFrequency) } }(resp) - poolingError := <-errs - if poolingError != nil { - return poolingError + pollingError := <-errs + if pollingError != nil { + return pollingError } } } @@ -310,8 +310,8 @@ func init() { fs.BoolVar(&uploadOptsCustomTranslationStatusInsertedKeys, "custom-translation-status-inserted-keys", true, "Add specified custom translation statuses to inserted keys (default true). Use --custom-translation-status-inserted-keys=false to disable.") fs.BoolVar(&uploadOptsCustomTranslationStatusUpdatedKeys, "custom-translation-status-updated-keys", true, "Add specified custom translation statuses to updated keys (default true). Use --custom-translation-status-updated-keys=false to disable.") fs.BoolVar(&uploadOptsCustomTranslationStatusSkippedKeys, "custom-translation-status-skipped-keys", false, "Add specified custom translation statuses to skipped keys.") - fs.BoolVar(&uploadPooling, "pool", false, "Enable to wait until background file upload finishes with result") - fs.DurationVar(&uploadPoolingTimeout, "pool-timeout", 30*time.Second, "Specify custom file upload pooling maximum duration. Default: 30s") + fs.BoolVar(&uploadPolling, "poll", false, "Enable to wait until background file upload finishes with result") + fs.DurationVar(&uploadPollingTimeout, "poll-timeout", 30*time.Second, "Specify custom file upload polling maximum duration. Default: 30s") } //noinspection GoUnhandledErrorResult diff --git a/cmd/root.go b/cmd/root.go index 9ffa378..be9449d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -13,7 +13,7 @@ import ( ) const ( - Version = "2.5.0" + Version = "2.5.1" DefaultPageLimit = 5000 ) diff --git a/docs/lokalise2.md b/docs/lokalise2.md index a4128c7..5fe2240 100644 --- a/docs/lokalise2.md +++ b/docs/lokalise2.md @@ -1,10 +1,10 @@ ## lokalise2 -Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go ### Synopsis -Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go ### Options diff --git a/docs/lokalise2_branch.md b/docs/lokalise2_branch.md index 26cf8c5..9f670f7 100644 --- a/docs/lokalise2_branch.md +++ b/docs/lokalise2_branch.md @@ -22,7 +22,7 @@ Manage branches ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 branch create](lokalise2_branch_create.md) - Create a branch * [lokalise2 branch delete](lokalise2_branch_delete.md) - Delete a branch * [lokalise2 branch list](lokalise2_branch_list.md) - List all branches diff --git a/docs/lokalise2_comment.md b/docs/lokalise2_comment.md index 3e7fef0..02082d4 100644 --- a/docs/lokalise2_comment.md +++ b/docs/lokalise2_comment.md @@ -22,7 +22,7 @@ Comments can be used to give translators a context about the key, or as a discus ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 comment create](lokalise2_comment_create.md) - Add a comment * [lokalise2 comment delete](lokalise2_comment_delete.md) - Delete a comment * [lokalise2 comment list](lokalise2_comment_list.md) - List project comments diff --git a/docs/lokalise2_contributor.md b/docs/lokalise2_contributor.md index 4bce58a..c2d5c7f 100644 --- a/docs/lokalise2_contributor.md +++ b/docs/lokalise2_contributor.md @@ -22,7 +22,7 @@ You may add unlimited number of contributors to your project. User roles include ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 contributor create](lokalise2_contributor_create.md) - Create a contributor * [lokalise2 contributor delete](lokalise2_contributor_delete.md) - Delete a contributor * [lokalise2 contributor list](lokalise2_contributor_list.md) - List all contributors diff --git a/docs/lokalise2_file.md b/docs/lokalise2_file.md index 936cb27..914ebee 100644 --- a/docs/lokalise2_file.md +++ b/docs/lokalise2_file.md @@ -22,7 +22,7 @@ Lokalise is a project-oriented translation management system, which means we sto ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 file download](lokalise2_file_download.md) - Download files * [lokalise2 file list](lokalise2_file_list.md) - List all files * [lokalise2 file upload](lokalise2_file_upload.md) - Upload a file diff --git a/docs/lokalise2_file_upload.md b/docs/lokalise2_file_upload.md index 7cf75a6..e3dfdca 100644 --- a/docs/lokalise2_file_upload.md +++ b/docs/lokalise2_file_upload.md @@ -28,8 +28,8 @@ lokalise2 file upload [flags] --include-path Include relative directory name in the filename when uploading. --keys-to-values Enable to automatically replace values with key names. --lang-iso string Language code of the translations in the file you are importing (required). - --pool Enable to wait until background file upload finishes with result - --pool-timeout duration Specify custom file upload pooling maximum duration. Default: 30s (default 30s) + --poll Enable to wait until background file upload finishes with result + --poll-timeout duration Specify custom file upload polling maximum duration. Default: 30s (default 30s) --replace-modified Enable to replace translations, that have been modified (in the file being uploaded). --slashn-to-linebreak Enable to replace \n with a line break (default true). Use --slashn-to-linebreak=false to disable. (default true) --tag-inserted-keys Add specified tags to inserted keys (default true). Use --tag-inserted-keys=false to disable (default true) diff --git a/docs/lokalise2_key.md b/docs/lokalise2_key.md index 3e74155..b917e80 100644 --- a/docs/lokalise2_key.md +++ b/docs/lokalise2_key.md @@ -25,7 +25,7 @@ Each phrase that is used in your app or website must be identified by a key and ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 key create](lokalise2_key_create.md) - Create keys * [lokalise2 key delete](lokalise2_key_delete.md) - Delete a key * [lokalise2 key list](lokalise2_key_list.md) - List all keys diff --git a/docs/lokalise2_language.md b/docs/lokalise2_language.md index 6621813..926b55f 100644 --- a/docs/lokalise2_language.md +++ b/docs/lokalise2_language.md @@ -25,7 +25,7 @@ There are situations when it is necessary to export different language codes to ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 language create](lokalise2_language_create.md) - Create languages * [lokalise2 language delete](lokalise2_language_delete.md) - Delete a language * [lokalise2 language list](lokalise2_language_list.md) - List project languages diff --git a/docs/lokalise2_order.md b/docs/lokalise2_order.md index 87d3c4a..357613f 100644 --- a/docs/lokalise2_order.md +++ b/docs/lokalise2_order.md @@ -22,7 +22,7 @@ Lokalise offers several human-powered translation providers, that can help trans ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 order create](lokalise2_order_create.md) - Create an order * [lokalise2 order list](lokalise2_order_list.md) - List all orders * [lokalise2 order retrieve](lokalise2_order_retrieve.md) - Retrieve an order diff --git a/docs/lokalise2_payment-card.md b/docs/lokalise2_payment-card.md index a106a98..30d7bb9 100644 --- a/docs/lokalise2_payment-card.md +++ b/docs/lokalise2_payment-card.md @@ -21,7 +21,7 @@ Credit cards are used to pay for translation orders. Each user has their own car ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 payment-card create](lokalise2_payment-card_create.md) - Create a card * [lokalise2 payment-card delete](lokalise2_payment-card_delete.md) - Delete a card * [lokalise2 payment-card list](lokalise2_payment-card_list.md) - Lists all cards diff --git a/docs/lokalise2_project.md b/docs/lokalise2_project.md index 6cda2b5..390142f 100644 --- a/docs/lokalise2_project.md +++ b/docs/lokalise2_project.md @@ -21,7 +21,7 @@ Lokalise is a project-based translation management system. We recommend to keep ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 project create](lokalise2_project_create.md) - Create a project * [lokalise2 project delete](lokalise2_project_delete.md) - Delete a project * [lokalise2 project empty](lokalise2_project_empty.md) - Empty a project diff --git a/docs/lokalise2_queued-process.md b/docs/lokalise2_queued-process.md index aea338c..878063f 100644 --- a/docs/lokalise2_queued-process.md +++ b/docs/lokalise2_queued-process.md @@ -22,7 +22,7 @@ Manage queued processes. Some heavy actions are processed asynchronously. Queued ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 queued-process list](lokalise2_queued-process_list.md) - Lists all queued processes for a project * [lokalise2 queued-process retrieve](lokalise2_queued-process_retrieve.md) - Retrieve a process for a project diff --git a/docs/lokalise2_screenshot.md b/docs/lokalise2_screenshot.md index bc7c38d..7aaff21 100644 --- a/docs/lokalise2_screenshot.md +++ b/docs/lokalise2_screenshot.md @@ -22,7 +22,7 @@ Manage screenshots ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 screenshot create](lokalise2_screenshot_create.md) - Create a screenshot * [lokalise2 screenshot delete](lokalise2_screenshot_delete.md) - Delete a screenshot * [lokalise2 screenshot list](lokalise2_screenshot_list.md) - List all screenshots diff --git a/docs/lokalise2_snapshot.md b/docs/lokalise2_snapshot.md index 9d3c8bd..75ab3a0 100644 --- a/docs/lokalise2_snapshot.md +++ b/docs/lokalise2_snapshot.md @@ -22,7 +22,7 @@ Manage snapshots ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 snapshot create](lokalise2_snapshot_create.md) - Create a snapshot * [lokalise2 snapshot delete](lokalise2_snapshot_delete.md) - Delete a snapshot * [lokalise2 snapshot list](lokalise2_snapshot_list.md) - List all snapshots diff --git a/docs/lokalise2_task.md b/docs/lokalise2_task.md index a5a7db4..dc717d3 100644 --- a/docs/lokalise2_task.md +++ b/docs/lokalise2_task.md @@ -22,7 +22,7 @@ Manage tasks ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 task create](lokalise2_task_create.md) - Create a task * [lokalise2 task delete](lokalise2_task_delete.md) - Delete a task * [lokalise2 task list](lokalise2_task_list.md) - List all tasks diff --git a/docs/lokalise2_team-user-group.md b/docs/lokalise2_team-user-group.md index 5e32773..570e80f 100644 --- a/docs/lokalise2_team-user-group.md +++ b/docs/lokalise2_team-user-group.md @@ -22,7 +22,7 @@ Manage team user groups ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 team-user-group add-members](lokalise2_team-user-group_add-members.md) - Add members to the group * [lokalise2 team-user-group add-projects](lokalise2_team-user-group_add-projects.md) - Add projects to the group * [lokalise2 team-user-group create](lokalise2_team-user-group_create.md) - Create a new user group diff --git a/docs/lokalise2_team-user.md b/docs/lokalise2_team-user.md index 10ceb81..02db304 100644 --- a/docs/lokalise2_team-user.md +++ b/docs/lokalise2_team-user.md @@ -22,7 +22,7 @@ Manage team users ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 team-user delete](lokalise2_team-user_delete.md) - Delete a team user * [lokalise2 team-user list](lokalise2_team-user_list.md) - List all team users * [lokalise2 team-user retrieve](lokalise2_team-user_retrieve.md) - Retrieves a team user diff --git a/docs/lokalise2_team.md b/docs/lokalise2_team.md index 72aed01..676e222 100644 --- a/docs/lokalise2_team.md +++ b/docs/lokalise2_team.md @@ -21,7 +21,7 @@ List teams ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 team list](lokalise2_team_list.md) - List all teams ###### Auto generated by spf13/cobra on 28-May-2020 diff --git a/docs/lokalise2_translation-provider.md b/docs/lokalise2_translation-provider.md index e0df75d..825d857 100644 --- a/docs/lokalise2_translation-provider.md +++ b/docs/lokalise2_translation-provider.md @@ -22,7 +22,7 @@ Translation providers are used for translation orders. ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 translation-provider list](lokalise2_translation-provider_list.md) - List all providers * [lokalise2 translation-provider retrieve](lokalise2_translation-provider_retrieve.md) - Retrieve a provider diff --git a/docs/lokalise2_translation-status.md b/docs/lokalise2_translation-status.md index b24f009..eb2d224 100644 --- a/docs/lokalise2_translation-status.md +++ b/docs/lokalise2_translation-status.md @@ -22,7 +22,7 @@ Custom translation statuses are used to provide a more efficient translation wor ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 translation-status create](lokalise2_translation-status_create.md) - Create a status * [lokalise2 translation-status delete](lokalise2_translation-status_delete.md) - Delete a status * [lokalise2 translation-status list](lokalise2_translation-status_list.md) - List all statuses diff --git a/docs/lokalise2_translation.md b/docs/lokalise2_translation.md index f093f39..3070266 100644 --- a/docs/lokalise2_translation.md +++ b/docs/lokalise2_translation.md @@ -22,7 +22,7 @@ Manage translations ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 translation list](lokalise2_translation_list.md) - List all translations * [lokalise2 translation retrieve](lokalise2_translation_retrieve.md) - Retrieve a translation * [lokalise2 translation update](lokalise2_translation_update.md) - Update a translation diff --git a/docs/lokalise2_webhook.md b/docs/lokalise2_webhook.md index 96a7e24..695de51 100644 --- a/docs/lokalise2_webhook.md +++ b/docs/lokalise2_webhook.md @@ -22,7 +22,7 @@ Manage webhooks ### SEE ALSO -* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.0. Read the docs at https://github.com/lokalise/lokalise-cli-2-go +* [lokalise2](lokalise2.md) - Lokalise CLI v2.5.1. Read the docs at https://github.com/lokalise/lokalise-cli-2-go * [lokalise2 webhook create](lokalise2_webhook_create.md) - Create a webhook * [lokalise2 webhook delete](lokalise2_webhook_delete.md) - Delete a webhook * [lokalise2 webhook list](lokalise2_webhook_list.md) - List all webhooks