docs: function install(path, command, template, force) {
          var gen = generate(path, command, template); // generate script and paths.
          if (fs_1.existsSync(gen.paths.completionsPath) && force !== true) {
              pargv.error(pargv._localize("completions already installed at %s, use --force to reinstall.")
                  .args(gen.paths.completionsPath)
                  .styles(colors.accent)
                  .done());
              return;
          }
          if (!gen.paths.bashPath) { // failed to gen bash path probably windows.
              pargv.error(pargv._localize("\"cannot automatically install completions on platform %s.")
                  .args(pargv._env.PLATFORM)
                  .styles(colors.accent)
                  .done());
              return;
          }
          var tmp = true;
          if (ensureDir(gen.paths.completionsDir)) { // ensure dir exists.
              if (write(gen.paths.completionsPath, gen.script)) { // write out completion script.
                  // const source = `source ${gen.paths.completionsPath}`;
                  if (write(gen.paths.bashPath, gen.sourceScript, true)) { // append to profile.
                      return gen; // return the successful configuration.
                  }
                  else {
                      pargv.error(pargv._localize("could not write, append or create path %s.")
                          .args(gen.paths.bashPath)
                          .styles(colors.accent)
                          .done());
                  }
              }
              else {
                  pargv.error(pargv._localize("could not write, append or create path %s.")
                      .args(gen.paths.completionsPath)
                      .styles(colors.accent)
                      .done());
              }
          }
          else {
              pargv.error(pargv._localize("could not write, append or create path %s.")
                  .args(gen.paths.completionsDir)
                  .styles(colors.accent)
                  .done());
          }
          return false; // return false to indicate install failed.
      }