InitCommand constructor

InitCommand()

Implementation

InitCommand()
    : super(
        'init',
        'Add or update the alex section in the agent instructions '
            'of the project.\n\n'
            'The section describes the project (locales, l10n paths, '
            'branches, FVM) and the commands an agent should use, '
            'so an agent learns about alex from the file it reads first. '
            'Everything is generated from the alex config and the commands '
            'tree, so it can be updated at any time.\n\n'
            'The section is wrapped in the markers '
            '`${ManagedBlock.beginMarker}` and `${ManagedBlock.endMarker}`, '
            'nothing outside of them is changed.\n\n'
            'By default the files are taken from the `agents.files` config '
            'option, or ${_kDefaultFiles.join(' and ')} if they exist, '
            'otherwise $_kFallbackFile is created.\n\n'
            'Exit code is 0 if the files are up to date or updated, '
            '$_kExitCodeOutdated if some file is missing or outdated '
            'and --$_argCheck is passed.',
      ) {
  argParser
    ..addMultiOption(
      _argFile,
      abbr: 'f',
      help: 'File with the agent instructions to add the section in. '
          'Can be passed multiple times.',
      valueHelp: 'PATH',
    )
    ..addFlag(
      _argCheck,
      help: 'Do not change anything, just check that the files exist '
          'and the section in them is up to date.',
      negatable: false,
    )
    ..addFormatOption();
}