moreThanOneArgumentError property

String moreThanOneArgumentError
final

Error message displayed when more than one argument is passed or unsupported arguments are used.

This error occurs when the user provides multiple command-line arguments or uses arguments other than the supported -g or --generate options.

The message provides:

  • Information about supported arguments since version 1.3.2
  • Usage examples with correct syntax
  • A table of all supported commands and their descriptions
  • Links to documentation for more information

Supported arguments:

  • -g or --generate: Specify the generation mode

Valid generation modes:

  • dart: Generate both keys and values
  • dart-keys: Generate only key constants
  • dart-values: Generate only value maps
  • json-values: Generate JSON value files

Returns: A String containing the detailed error message with usage examples

Implementation

static final String moreThanOneArgumentError = '''
------------------------------------------------------------------------------------------------------------
-> Passing arguments other then -g (or) --generate is not supported from translations_code_gen: 1.3.2.

-> Example:
  translations_code_gen -g=json-values
  translations_code_gen --generate=json-values

->|--------------------|-------------|----------------------------------------|
  | Command            | Value       | Description                            |
  |--------------------|-------------|----------------------------------------|
  | -g (or) --generate | dart        | Generate dart code for keys and values.|
  |                    | dart-keys   | Generate dart code for keys only.      |
  |                    | dart-values | Generate dart code for values only.    |
  |                    | json-values | Generate dart code for values only.    |
  |--------------------|-------------|----------------------------------------|

-> You must specify the input and output files for the keys and values generation.
-> Specify in the pubspec.yaml file or create a translations_code_gen.yaml file to specify it.
-> For more information visit: https://pub.dev/packages/translations_code_gen
-> or visit: https://github.com/youhanasheriff/translations_code_gen
------------------------------------------------------------------------------------------------------------
''';