static void Main(string[] args)
 {
     CommandLine.Parser.Default.ParseArguments <
         MetadataSourceStatusOptions,
         FetchUpdatesOptions,
         QueryMetadataOptions,
         MetadataSourceExportOptions,
         ContentSyncOptions,
         RunUpstreamServerOptions,
         MergeQueryResultOptions,
         FetchCategoriesOptions,
         FetchConfigurationOptions,
         MatchDriverOptions>(args)
     .WithParsed <FetchUpdatesOptions>(opts => MetadataSync.FetchUpdates(opts))
     .WithParsed <FetchConfigurationOptions>(opts => MetadataSync.FetchConfiguration(opts))
     .WithParsed <FetchCategoriesOptions>(opts => MetadataSync.FetchCategories(opts))
     .WithParsed <QueryMetadataOptions>(opts => MetadataQuery.Query(opts))
     .WithParsed <MatchDriverOptions>(opts => MetadataQuery.MatchDrivers(opts))
     .WithParsed <MetadataSourceExportOptions>(opts => UpdateMetadataExport.ExportUpdates(opts))
     .WithParsed <ContentSyncOptions>(opts => ContentSync.Run(opts))
     .WithParsed <MetadataSourceStatusOptions>(opts => MetadataQuery.Status(opts))
     .WithParsed <RunUpstreamServerOptions>(opts => UpstreamServer.Run(opts))
     .WithParsed <MergeQueryResultOptions>(opts => MetadataSync.MergeQueryResult(opts))
     .WithNotParsed(failed => Console.WriteLine("Error"));
 }
Exemple #2
0
        /// <summary>
        ///  Runs a query command against a metadata source
        /// </summary>
        /// <param name="options">Query options (filters)</param>
        public static void Query(QueryMetadataOptions options)
        {
            var source = Program.LoadMetadataSourceFromOptions(options as IMetadataSourceOptions);

            if (source == null)
            {
                return;
            }

            var repoQuery = new MetadataQuery(source, options);

            repoQuery.Query();
        }