hunk.code_window: // Service implements the CLIService interface
   type Service struct{}
   const (
   	errInvalidEnpointProtocol  = portainer.Error("Invalid endpoint protocol: Portainer only supports unix:// or tcp://")
   	errSocketNotFound          = portainer.Error("Unable to locate Unix socket")
   	errEndpointsFileNotFound   = portainer.Error("Unable to locate external endpoints file")
   	errInvalidSyncInterval     = portainer.Error("Invalid synchronization interval")
   	errEndpointExcludeExternal = portainer.Error("Cannot use the -H flag mutually with --external-endpoints")
   )
   // ParseFlags parse the CLI flags and return a portainer.Flags struct
   func (*Service) ParseFlags(version string) (*portainer.CLIFlags, error) {
  
hunk.labels: keep keep keep keep replace replace replace replace replace keep keep keep keep
hunk.after_edit: 	errInvalidEndpointProtocol     = portainer.Error("Invalid endpoint protocol: Portainer only supports unix:// or tcp://")
   	errSocketNotFound              = portainer.Error("Unable to locate Unix socket")
   	errEndpointsFileNotFound       = portainer.Error("Unable to locate external endpoints file")
   	errInvalidSyncInterval         = portainer.Error("Invalid synchronization interval")
   	errEndpointExcludeExternal     = portainer.Error("Cannot use the -H flag mutually with --external-endpoints")
   	errNoAuthExcludeAdminPassword  = portainer.Error("Cannot use --no-auth with --admin-password")
  
hunk.file_path: api/cli/cli.go
hunk.type: replace
file: angular.module('sidebar', [])
  .controller('SidebarController', ['$scope', '$state', 'Settings', 'Config', 'EndpointService', 'StateManager', 'EndpointProvider', 'Notifications', 'Authentication',
  function ($scope, $state, Settings, Config, EndpointService, StateManager, EndpointProvider, Notifications, Authentication) {
  
    Config.$promise.then(function (c) {
      $scope.logo = c.logo;
    });
  
    $scope.uiVersion = Settings.uiVersion;
    $scope.userRole = Authentication.getUserDetails().role;
  
    $scope.switchEndpoint = function(endpoint) {
      var activeEndpointID = EndpointProvider.endpointID();
      EndpointProvider.setEndpointID(endpoint.Id);
      StateManager.updateEndpointState(true)
      .then(function success() {
        $state.go('dashboard');
      })
      .catch(function error(err) {
        Notifications.error("Failure", err, "Unable to connect to the Docker endpoint");
        EndpointProvider.setEndpointID(activeEndpointID);
        StateManager.updateEndpointState(true)
        .then(function success() {});
      });
    };
  
    function fetchEndpoints() {
      EndpointService.endpoints()
      .then(function success(data) {
        $scope.endpoints = data;
        var activeEndpointID = EndpointProvider.endpointID();
        angular.forEach($scope.endpoints, function (endpoint) {
          if (endpoint.Id === activeEndpointID) {
            $scope.activeEndpoint = endpoint;
          }
        });
      })
      .catch(function error(err) {
        $scope.endpoints = [];
      });
    }
  
    fetchEndpoints();
  }]);
  